This is my first day using python and I've been following along with a youtube video to try and learn. I've copied the code exactly but as you can see the formatting of the last line in the shell has gone really weird and displaying text out of order and missing out some of it.
Any help as to why this is?
Use these definitions to keep your code working even on non-replit systems:
# reference to original print and input functions real_print = print real_input = input # fix replit print function def print(text, end="\n"): lines = text.splitlines() if len(lines) > 0: for line in lines[:-1]: real_print(line) real_print(lines[-1], end=end) else: real_print("", end=end) # fix replit input function def input(prompt=""): print(prompt, "") return real_input()
input is very very very buggy on replit.
Please, use this function instead:
def _input(text='') print(text, end='') return input()
Add it to the TOP of the file.
so when they do a
input(), actually type in
Well the indentations are from the pasted code. The code going on multiple lines is just due to the size of the window. You can change that by adjusting the line between the output window and input window.