+ 1
Whats wrong with this code?
nums = [0,2,3,4] msg = "Points :{0} {2} {3} {4}".format(nums[0],nums[1],nums[2],nums[3]) print(msg)
3 RĂ©ponses
+ 5
The string formatting you use mentions the position {4} which is not provided in the .format method. Remember that Python counts from 0, so {4} means inserting the *fifth* element. And you only provide four in the .format method.
0
ok, i thought that i should put the numbers from the list inside the {}