I have a list like this:
List= [("Mike,"Admin","26,872"),
("John,"Admin","32,872"),
("Mark,"Admin","26,232")...]
what I want to achieve is the following:
List= [("Mike,"Admin", 26872),
("John,"Admin", 32872),
("Mark,"Admin", 26232)...]
so for the every third element I want to remove comma and convert it to int. I tried for example to do replace but the list doesn't support replace method.
Just a test:
accounts = sorted(List, key=lambda account: account[2], reverse=True)
for i,j,k in accounts:
k.replace(",", "")
int k
Any ideas?