Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting error: Name error
#5
It should be input, not raw_input, because you use python3 (that is the right thing to do).
raw_input is python2, in python3 it is just input

As a general remark - I would expect the author of the book will ask you to run the sample code in almost all of the cases. It just happens that in this particular case they try to explain a concept and are focused on this incomplete snippet. I will leave to you to decide if this is good or bad/confusing approach.
Here is one thread and one more
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Getting error: Name error - by Placebo - Sep-07-2018, 06:56 AM
RE: Getting error: Name error - by buran - Sep-07-2018, 07:09 AM
RE: Getting error: Name error - by Axel_Erfurt - Sep-07-2018, 07:19 AM
RE: Getting error: Name error - by Placebo - Sep-07-2018, 09:40 AM
RE: Getting error: Name error - by buran - Sep-07-2018, 09:50 AM
RE: Getting error: Name error - by Placebo - Sep-07-2018, 01:28 PM
RE: Getting error: Name error - by Placebo - Sep-08-2018, 06:32 AM
RE: Getting error: Name error - by buran - Sep-08-2018, 06:58 AM
RE: Getting error: Name error - by Placebo - Sep-08-2018, 07:53 AM
RE: Getting error: Name error - by buran - Sep-08-2018, 08:18 AM
RE: Getting error: Name error - by Placebo - Sep-08-2018, 01:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line Anldra12 9 15,614 Jun-15-2021, 08:16 AM
Last Post: Anldra12
  cx_Oracle.DatabaseError: Error while trying to retrieve text from error ORA-01804 rajeshparadker 0 8,678 Nov-12-2020, 07:34 PM
Last Post: rajeshparadker
  Coding error- Not sure where I have put error markers against the code that is wrong Username9 1 1,781 Sep-28-2020, 07:57 AM
Last Post: buran
  Type Error or Value Error? spalisetty06 3 2,445 Jul-21-2020, 04:56 AM
Last Post: deanhystad
  Error in Python3.6:free() Corrupted unsorted chunks error sameer_k 2 3,943 Mar-18-2020, 09:37 AM
Last Post: sameer_k
  ERROR:haproxystats:Error fetching stats deepakkr3110 1 2,069 Nov-12-2019, 12:29 PM
Last Post: Larz60+
  Error :unable to detect undefined names created in spyder ide error at line 2 milind_eac 2 8,352 Jul-30-2019, 10:29 PM
Last Post: milind_eac
  Getting error "Type error-a bytes-like object..." mrapple2020 1 5,458 Apr-06-2019, 06:37 PM
Last Post: mrapple2020
  Program gives error but doesn't say where the error is. FWendeburg 3 2,868 Mar-09-2019, 11:42 PM
Last Post: FWendeburg
  I have Traceback error and a type error and i dont know how to fix it coltron1282 2 2,572 Feb-07-2019, 03:15 PM
Last Post: coltron1282

Forum Jump:

User Panel Messages

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