Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My 1st Program
#2
Simple answer - this code is intended to run on python3 and you are running it on python2. As you are new to python - install python3 and use it, not python2. Support for python2 will end soon.

The reason behind the problem - in python2 one should use raw_input() instead of input(). In python2 input() evaluates the user input as if it is valid python code, while raw_input() just returns user input as string.
In python3 input() returns user input as string, so it is equivalent to raw_input() in python2.
Reply


Messages In This Thread
My 1st Program - by ineedhelp - Jan-26-2018, 07:49 AM
RE: My 1st Program - by buran - Jan-26-2018, 07:55 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020