This is my code so far:
things = ['humans', 'fish', 'plants', 'planets', 'stars']
print('These are types of things we learnt so far:')
for thing in things:
print(thing, end=', ')
print()
print(len(things))
the_input = int(input('Now please enter a number which you want to print: '))
print(f'You have chosen {the_input} which is {things[the_input]}.')
# the unfinished rest:
# the_input = int(input('Now please enter a number which you want to print: '))
# if the_input == the index number of indexes of things list,
# then print:
# You have chosen {the_input} which is {things[the_input]}
This is my expected output:
These are types of things we learnt so far:
1) humans, 2) fish, 3) plants, 4) planets, 5) stars
Now please enter a number which you want to print:
2 # this is the input of terminal, not the output of print(the_input)
You have chosen 2 which is fish.
For this code I don't know how to do this (there maybe other issues but I'm not yet aware of them):
- The first print statement to show
index_number) each_list_item
- to omit the last
,
which is shown in my code if you run it