Python code - Coffee Machine
Hi everyone, my code passes all the tests except one, where it gives no output under the exception. I looked on Stack Overflow, GeeksforGeeks, a few other sites from Google searches and tried to tweak the code but still no luck. Can anyone help please? choice = int(input()) coffee = ["Café Latte", "Caffe Americano", "Espresso", "Cappuccino", "Macchiato"] try: #your code goes here #for i in choice: #for j in coffee.index(): #if i == j: #print(coffee[choice]) if choice in range(len(coffee)): print(coffee[choice]) except: #raise exception ("Invalid number") print("Invalid number") #and here #if choice not in range(len(coffee)): finally: #and finally here print("Have a good day")