Q&A Discussies
I 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 Stemmen
 5 AntwoordenC++ for Unrealengine?
 1 Stem
 1 AntwoordHello guys right now I am kinda of new in python
my question is related to the function call len()
len() its print out the character but here it's the confusing part, I am working with a list let me explain an example 
players
['lee', 'bob', 'moe', 'joe']
len(players)
4 
why it's giving me 4 item in the list I thought len it counts the characters and if I do this it give me the correct somewhat answer what I am seeking,  
len(players [-1])
3
 0 Stemmen
 8 AntwoordenHow to print 34 + 45 in CPython
 0 Stemmen
 1 AntwoordIn the continue Loop - 
i = 0
while True:
    i = i +1
    if i == 2:
        print("Skipping 2")
        continue
    if i == 5:
        print("Breaking")
        break
    print(i)
print("Finished")
It shows the output being 
"1
Skipping 2
3
4
Breaking
Finished"
Why are the last three lines not 
"Breaking 
5
Finished"
Where it shows print(i) after break? 
 1 Stem
 3 Antwoordenin order to find the sum of  n numbers given by user,suppose our  program is to find the sum of any 4 numbers given by user (using while loop such that (while(i<=4))and incrementing each value of i by 1),if the user give any 2 inputs instead of four then the total sum should be the summation of that two inputs..but the program shows the sum something else,why it is so??
 2 Stemmen
 3 AntwoordenCan anyone help me to code this
Write a method 'timesTable()' which accepts an integer value num from the keyboard and uses it to print 'times table' of itself in a structured format. Your output must include a header row. For example, if the user enters 5, your program's output should be:
5 Times Table
1     5       5
2     5      10
3     5      15
4     5      20
5     5      25
6     5     30
 0 Stemmen
 5 AntwoordenRuby Array Question
 0 Stemmen
 3 AntwoordenAssign each track runner a roster number and calculate the average age of the team.
As output the program should print the roster in three columns like in the following format:
Roster #           Name                     Age
1                       First Name            18
2                       Second Name       19
3                       Third Name           19
4                       Fourth Name         20
5                       Fifth Name            18
The average age of the team is 18.80.
 -1 Stem
 1 AntwoordAssign each track runner a roster number and calculate the average age of the team.
As output the program should print the roster in three columns like in the following format:
Roster #           Name                     Age
1                       First Name            18
2                       Second Name       19
3                       Third Name           19
4                       Fourth Name         20
5                       Fifth Name            18
The average age of the team is 18.80.
 0 Stemmen
 1 AntwoordPopulair vandaag
Beginner question
 0 Votes
Remove
 0 Votes
I need help to solve this
 0 Votes
Project
 0 Votes
Engineer Cloud
 0 Votes
Lua?
 1 Votes