Hello,
I am trying to place several values from a list into a string. The code I have is below:
ID = [0, 1, 2]
print 'ID {0}, {1}, and {2}.'.format(ID)
or
print (r'(ID\s*=\s*)(\S+)').format(ID)
This does not work. Does anyone know where I'm going wrong. The code in the second line prints out the list:
[0, 1, 2]
the first line says:
File "tset.py", line 39, in b
print 'ID {0}, {1}, and {2}.'.format(ID)
IndexError: tuple index out of range
Thanks