Ask coding questions

← Back to all posts
How do I prevent text from overwriting existing text in the console?
h
marianadesigns (0)

During my code, I asked two questions (line 279 and line 287). When its printed as the output in the console, the text overwrites itself as well as when the user has to type in something.

Here is what I mean:
Question #1:

Question #2:

How would I prevent text from overwriting existing text in the console?

Answered by Wumi4 (504) [earned 5 cycles]
View Answer
Comments
hotnewtop
Wumi4 (504)

No need to worry about that. Repl has a problem with inputting text. If you run your code on your computer, the input won't be overwritten.

marianadesigns (0)

Okay! Thank you very much. I will try [email protected]

Coder100 (17620)

Use this function instead:

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

basically replit python doesn't exactly render input the best, so you have to use the print instead.