I have this piece of code in python 3:
i=0
for item in splitDict(Team, 3):
i+=1
print("{1} #{0}".format(i,item))
What I'd like to do is:
i=0
for item in splitDict(Team, 3):
print("{1} #{0}".format(i+=1,item))
Notice I've put the increment into the format statement. But when I run it I get the error:
print("{1} #{0}".format(i+=1,item))
^
SyntaxError: invalid syntax
My question is how can I get it to increment in the print statement?
enumerateand you don't have to increment manually.