+ 3

How does input()/raw_input() work in Python 3?

I took the Python course over the span of a couple of days, but I didn’t understand a lot of it: including how to get people to input text into a game. I’ve done a ton of research, but I can’t figure it out. I even tried searching through the course again, but I didn’t find anything helpful. For a clearer example: I watched this one person on YouTube use “answer” instead of “txt” [answer=Input()]. I’ve tried both and neither of them work.

16th Jun 2019, 5:26 PM
Whanos
Whanos - avatar
5 Answers
+ 4
đŸ€” What's the code you're trying to run?
16th Jun 2019, 5:51 PM
Faisal
Faisal - avatar
+ 3
If I understand your question correctly, could it be because you're capitalizing the input() function? Python is case sensitive, so for it to work you must use input() rather than Input()
16th Jun 2019, 5:45 PM
Faisal
Faisal - avatar
+ 3
no, that’s not it. I have input written at lowercase. This forum just kept trying to capitalize input for some reason. I tried to fix it but I stopped trying.
16th Jun 2019, 5:50 PM
Whanos
Whanos - avatar
+ 3
ok. wow. never mind. I forgot that I set the code playground to swift because I wanted to get back into learning Swift. Then I tried coding in Python. That’s the problem.
16th Jun 2019, 5:54 PM
Whanos
Whanos - avatar
0
input is for version 3.6.5 but raw input for version 2.7.5
22nd Jun 2019, 7:33 AM
Muskan Singh
Muskan Singh - avatar