subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:40
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i.e., still have an asterisk in it).
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 24.06.2019 08:30
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
question
Computers and Technology, 25.06.2019 00:30
Which email writing etiquette should ariel follow to let people know that she received their message? a. reply to their messages immediately b. use formal language c. specify the email's intent in the subject field d. be direct when writing the reply
Answers: 1
You know the right answer?
Ok, this is for computer science we’re suppose to make a program that takes a user input and the use...
Questions
question
Mathematics, 29.10.2020 17:20
question
Mathematics, 29.10.2020 17:20
question
Chemistry, 29.10.2020 17:20
question
Social Studies, 29.10.2020 17:20