Raw_Input () is undefined

I am a seventh-class programmer, so I may miss a lot of things in this program, but for my code club my instructor asked us to guess the number of the game. I have very limited knowledge in this subject since I attended only four classes. Anyway, when I run this program in Python IDLE 3.5, this is what it says:

Traceback (most recent call last): File "C:\Users\morrris\AppData\Local\Programs\Python\Python35-32\guess_that_number.py", line 7, in <module> name= raw_input() NameError: name 'raw_input' is not defined 

I tried changing the code, but did not seem to like raw_input ().

+5
source share
1 answer

For Python 3.x, use input() . For Python 2.x, use raw_input() . Remember to add a prompt line to your input() call to create another print statement. input("GUESS THAT NUMBER!") .

+15
source

Source: https://habr.com/ru/post/1242148/


All Articles