Computers and Technology

Ok, this is for computer science we’re suppose to make a program that takes a user input and the user’s input is suppose to be the total of a list. This is what I’ve got so far and my teacher said I was close but I shouldn’t use User_Number in the parameter. ( the indents are in the code for some reason they didn’t carry over thou )

User_Number = input(“What should the sum of numbers be? “)

Def Total(User_Number):

i = 1

numbers = [ ]

while i <= User_Number:

numbers. append( i )

i += 1

Sum_Total = 0

For i in numbers:

Sum_Total += numbers[ i - 1 ]

return Sum_Total

if __name__ == ‘__main__’:

print( Total )

The only things that must be in the program is: user input, a def statement with a parameter, the if name = min statement, and no preexisting functions for the math

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, keke6361
When using a public computer or network, you should always
Answers: 2
image
Computers and Technology, 23.06.2019 17:00, chrisgaz14
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, fordkenae
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
Answers: 1
image
Computers and Technology, 24.06.2019 12:50, neptunesx
Write a new lc-3 trap subroutine (i. e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i. e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e. g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e. g. b0000 0000 0000 0111 =
Answers: 3
Do you know the correct answer?
Ok, this is for computer science we’re suppose to make a program that takes a user input and the use...

Questions in other subjects:

Konu
Mathematics, 30.03.2021 20:50
Konu
Mathematics, 30.03.2021 20:50
Konu
Mathematics, 30.03.2021 20:50