• Kurse
  • Code Compiler
  • Diskutieren
  • Preise
  • Teams
Menu

F&A Diskussionen

Why 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
pythonstrings
1 Stimme
3 Antworten
16th Oct 2016, 10:28 PM
питер огнекрылый
питер огнекрылый - avatar
in 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??
c++loops
2 Stimmen
3 Antworten
12th Jan 2017, 4:40 AM
Pragya Priya
Pragya Priya - avatar
< Vorherige1...1718Weiter >
Heute heiß
How to properly reverse a string in python
4 Votes
Can someone explain how it works (im new)
1 Votes
AI Takeover
2 Votes
Using Python on VScode
1 Votes
Python Developer
0 Votes
Average of Two Numbers
0 Votes
Hearts
0 Votes
hi my coding instor told me to make a calculator that find the average of two numbers can you pls tell me my erro
0 Votes
Pls how can I make my coding go live
1 Votes
Can I take the certificates after finished the lessons?
1 Votes