Hello folks am new to python development.I have wrote a sample code:
mylist = ['something','baby','car']
for i,n in mylist:
mylist[i] = mylist[i]+1
print i,n
I know i is the index in the list so it will execute up to the number of elements in the list.But when I execute the script I get type error...
In this code the index of the list is inceremented by one... So the expected result is.
0 something
1 baby
2 car
Instead of that i got a typeerror..Please help me in solving this..Any help would be appreciated..Thanks