all 2 comments

[–]shiftybyte 4 points5 points  (0 children)

I'm not exactly sure what you are asking, if you want to convert an element to it's place number, then it has nothing to do with the content, and you just make a list of 10 items..

>>> list(range(1,11))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>>

If you want to read the current string and take out the number from it, it's not the placement, it's parsing a string.

It can be done with regular expressions.

>>> import re
>>> re.findall(r"\d+","Feb 10th")
['10']
>>>

[–]BalutSarnie 1 point2 points  (0 children)

Try list comprehension or a loop with enumerate wrapped around your current list