Ask coding questions

← Back to all posts
I need help formatting this code.
DEMEATER

I am making this a a project, but the code keeps formatting wierldy. Can anyone fix it pls

Comments
hotnewtop
Coder100

Replit's input is super glitched, here is your fixed version:
https://replit.com/@Coder100/OrneryIdenticalInitialization-aoeua-euaoe#main.py

using input_better function (by yours truly) makes it so replit isn't stupid anymore and actually uses a brain to print.

DEMEATER

@Coder100 thank you so much. This was a project for school, and if it failed, I would have gotten a bad grade. Thanks

Coder100

np!
mark as correct answer please @DEMEATER

IMayBeMe

Just click the auto format button in the corner of your screen

DEMEATER

@IMayBeMe but

when it prints each line, it prints wierdly

IMayBeMe

@DEMEATER Oh ok, to fix that you can a \n whenever you want a new line

DEMEATER

@IMayBeMe Thanks, but I want it to print out as "Which species of animal do you want-mammals(m), reptiles(r), fish(f), bird(b), amphibians(a): ", but it is printing out as "mphibians(a): of animal do you want-mammals(m), reptiles(r), fish(f), bird(b), am" with the input overlapping the text. How do I fix?
Thanks

DEMEATER

@IMayBeMe Actually, thanks for trying, but somebody else help[ed me by putting in this function: def input_better(text = ''):
print(text, end = '')
return input()