Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
newbie problem
#2
The book is intended/using Python3 while you run the code using Python2.

In Python2 raw_input() takes user input and returns str, in Python3 that is input()
In Python2 input() takes input from user and try to evaluate it as code, in Python3 that is eval(input())

Most probably you have both version of python installed, but if not I would recommend to install Python3. Use Python3 (especially given that you are new to Python). usually, if both versions are installed you can invoke Python3 by using
python3 yourscript.py, not python yourscript.py
Reply


Messages In This Thread
newbie problem - by Pedroski55 - Jul-04-2017, 05:28 AM
RE: newbie problem - by buran - Jul-04-2017, 06:25 AM
RE: newbie problem - by Pedroski55 - Jul-04-2017, 07:00 AM
RE: newbie problem - by buran - Jul-04-2017, 07:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  very newbie problem on text file zapad 2 450 Apr-12-2024, 06:50 PM
Last Post: zapad
  Newbie first problem cima_hurdle 8 3,818 Feb-09-2022, 10:02 PM
Last Post: cima_hurdle
  Newbie lists problem LedDiode 5 3,876 Dec-16-2018, 08:33 PM
Last Post: LedDiode
  Newbie Ubuntu script problem Kloontor 6 3,755 Sep-24-2018, 03:51 PM
Last Post: Kloontor
  Hey guys, help a newbie out with a list problem. sdezigner 2 2,823 Feb-15-2018, 06:06 PM
Last Post: sdezigner

Forum Jump:

User Panel Messages

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