Total Newbie question for which I have searched the site. I am running a really simple program in Chapter 2 of Automate the Boring Stuff and I keep getting a NameError. The firs
In the book you missed this comment above the code: "(Pretend name was assigned some value earlier.)". So you need to do that. For example (assuming Python 3):
name = input("Please enter your name: ")
if name == 'Alice':
print('Hi, Alice.')
By the way, next time you are searching for this kind of thing in a search engine, prefix the exception type with "python", for example "python NameError".