I have a list in python with following sample contents:
['mark', 29, 'american', 'james', 45, 'british', 'arthur', 76, 'australian']
as is clear from the pattern the first item in a list is name, second is age and the third is nationality.
What will be the most efficient way of iterating over it so as to separate the elements inside one for loop.
I am new to python and do not know the best method of doing it.
for i in len(0, len(my_list):
name =
age =
nationality =
one method of doing it is:
you can then iterate as