Plenty of times, when you are looping with a for-each loop in python, you somehow realize that you need a counter. Then you most probably write something ugly like this one:
1 2 3 4 |
a = 0 for count_value in my_odd_squares: a = a + 1 print(f'({a}, {count_value})') |
Why is this ugly? Mainly because the next…