I have a question about the chatbot exercise in python. With the following code I get a NameError and do not understand why.
print('Welcome to the cafe!')
size = get_size()
res = input('What size drink can I get for you? \n[a] Small \n[b] Medium \n[c] Large \n> ')
if res == 'a':
elif res == 'b':
elif res == 'c':
That should work, maybe you guys get why it does not. I have no idea, to me it looks fine and exactly like the hints and examples in the exercise.
Thanks for the help and happy coding!
Are you calling it with a version of Python3? I just tried a direct copy/paste of your original code and it ran as you expect in Python3 but with version 2 throws a name error because of the difference between raw_input and input.