+ 1
Python Input/List question
So I know that this code technically functions but it seems like there must be a simplified way. Please take a look and let me know if there is. Thank you https://code.sololearn.com/c8ms5uNZWT14/?ref=app
4 Réponses
+ 7
Can't access it. Paste the code into a new code in the playground, save it and paste the link here.
+ 2
fruits = ["apple", "cherry", "banana", "kiwi", "lemon", "pear", "peach", "avocado"]
print(fruits[int(input())])
0
Updated, apologies