Please help ASAP, 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