Jul-21-2019, 06:53 PM
In [2]: list(enumerate('My Name is andre')) Out[2]: [(0, 'M'), (1, 'y'), (2, ' '), (3, 'N'), (4, 'a'), (5, 'm'), (6, 'e'), (7, ' '), (8, 'i'), (9, 's'), (10, ' '), (11, 'a'), (12, 'n'), (13, 'd'), (14, 'r'), (15, 'e')]In a for-loop:
text = 'My name is Andre.' for index, char in enumerate('My name is Andre.'): print(index, char)
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!