Today I would like to show you something interesting that you can use. Take a look at this code:
things = [('teen', '10'), ('twenty', '20')]
How do you print this? You've probably already thought of some ways to do this and now I'm going to show you some::
for index, (word, number) in enumerate(numbers):
print(index, word, number)
When you run this code, you'll receive it:
0 teen 10
1 twenty 20
It is simple and useful, is it?
Hope you enjoy it, have a great day and an AWESOME year.
Top comments (0)