I have a question about the chatbot exercise in python. With the following code I get a NameError and do not understand why.
def coffee_bot(): print('Welcome to the cafe!') size = get_size() print(size) def 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': return 'small' elif res == 'b': return 'medium' elif res == 'c': return 'large' coffee_bot()
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!