can you anyone help me to print coffee names...? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can you anyone help me to print coffee names...?

in this code i did all but i am confuse what to change in choice so that i can print coffee names also.... coffee = ["Café Latte", "Caffe Americano", "Espresso", "Cappuccino", "Macchiato"] choice = int(input()) try: print (choice) except: print ("invalid number") finally: print ("Have a good day")

2nd Nov 2020, 10:48 AM
Rahul Prasad
Rahul Prasad - avatar
5 Answers
+ 4
Maybe you are looking for this print(coffee[choice])
2nd Nov 2020, 10:52 AM
Abhay
Abhay - avatar
+ 2
What is choice suppose to be?
2nd Nov 2020, 10:50 AM
Abhay
Abhay - avatar
+ 2
Yeah Thanks!
2nd Nov 2020, 10:55 AM
Rahul Prasad
Rahul Prasad - avatar
+ 2
Abhay thanks a lot for your code. It really helped. I've just changed my code according to it.
12th May 2021, 3:00 PM
Елена Леващева
Елена Леващева - avatar
0
list number to choose coffee names
2nd Nov 2020, 10:51 AM
Rahul Prasad
Rahul Prasad - avatar