Joined
·
264 Posts
Code:
The (*c) syntax is what is throwing me off, it's looks very much like a ptr, but obviously isn't.
I assume it's use is for the {0} and the {1} since only one variable is provided, I just can't find anything on google, any idea what the name is of that * operator? Even when I find a list of python images, I don't get * for multiplication, *= assignment and ** for exponents.
Code:
#!/usr/bin/python
colors = ["red","blue","green","yellow","brown","black"]
months = (
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec",
)
for c in enumerate(colors):
print "{0} {1}".format(*c)
print
for num,month in enumerate( months, 1 ):
print "{0} {1}".format( num, month )
I assume it's use is for the {0} and the {1} since only one variable is provided, I just can't find anything on google, any idea what the name is of that * operator? Even when I find a list of python images, I don't get * for multiplication, *= assignment and ** for exponents.