F&A Diskussionen
program prints multiple nums
0 Stimmen
4 Antwortensummartion of even nums
1 Stimme
2 AntwortenWhat is the meaning of : nums
0 Stimmen
3 AntwortenHow do I sum nums in a range
0 Stimmen
2 AntwortenCan I put nums in string var in cpp
-3 Stimmen
4 Antwortenwhy does python hate my colon?
4 Stimmen
4 AntwortenImport random
0 Stimmen
16 AntwortenWhy this code runs?:
nums = [4, 5, 6]
msg = "Numbers: {} {}". format(nums[0], nums[1], nums[2])
print(msg)
Numbers:4, 5.
Byt the code:
nums = [4, 5, 6]
msg = "Numbers: {} {} {} {}". format(nums[0], nums[1], nums[2])
print(msg)
leading to error?
IndexError: tuple index our of range
1 Stimme
3 AntwortenI dont unserstand the output if this code :
# string formatting
nums = [4, 5, 6]
msg = "Numbers: {0} {0} {2}". format(nums[0], nums[1], nums[2])
print(msg)
4 4 6
but when I do :
# string formatting
nums = [4, 5, 6]
msg = "Numbers: {0} {0} {2}". format(nums[1], nums[1], nums[2])
print(msg)
it gives me
5 5 6
is there a priority in the Reading ?
0 Stimmen
5 AntwortenHeute heiß
Pig Latin
0 Votes
Someone can help me
1 Votes
What's wrong with this?
2 Votes
I’m new someone can help me
1 Votes
HTML community, HELP!!
1 Votes
I am a super beginner
0 Votes
What's doctype htMl
2 Votes
How this program executes?
0 Votes
Pls give me an idea
1 Votes