Categories
How to display a list with the order of the elements?
You need to output a list like this:
1. home 2. watermelon
Answer the question
In order to leave comments, you need to log in
print('\n'.join(f'{i}. {n}' for i, n in enumerate(arr, 1)))
s = ['home', 'watermelon', 'apl', 'banana'] for i in range(1, len(s) + 1): print(i, ". ", s[i-1])
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question