Ask coding questions

← Back to all posts
What is happening here?
JohnWang12 (1)

This doesn't seem right... is this a glitch? (I made it print some text but it isn't aligned right and pressing any letter writes over them...)

edit: I made another repel with the part that seems to be causing it
edit 2: it seems like input() is the one that causes this, print() seems to work fine

Answered by Coder100 (18104) [earned 5 cycles]
View Answer
Coder100 (18104)

yes, use this function instead:

def input_better(text=''):
  print(text, end='', flush=True)
  return input()

print(input_better("this is so much better input, the reason why is because replit is a bit buggy with the python version."))
JohnWang12 (1)

@Coder100 Interesting! thank you!