Would you describe this code ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Would you describe this code ?

Would you describe this code, specially line 3 (comprehensively) ? https://code.sololearn.com/c4n45ypZOEDv/?ref=app

1st Feb 2018, 8:35 AM
NIMA
NIMA - avatar
2 Answers
0
msg = "Numbers: {0} {1} {2}". format(nums[0], nums[1], nums[2]) {0}=nums [0], If it was like {2} it's value would be equal to nums [2]
1st Feb 2018, 8:43 AM
Hileamlak Mulugeta
Hileamlak Mulugeta - avatar
0
{n} in format string indicate to format to replace this piece (curly brace and n) with the n-th parameter in format call (n start from zero)
1st Feb 2018, 8:58 AM
KrOW
KrOW - avatar