[Tutor] Trouble with SUM()
Ju Bo
justinthetransporter at gmail.com
Sat Apr 20 16:51:11 EDT 2019
Hi, I'm trying to write a program that uses a while loop to ask a user for
multiple values then use the program to add all the values, however many
there may be, then print the sum. I'm having trouble with the sum()
function. My code is below:
con = "y"
while con == "y":
AMT = float(input("What is the price of the item? $"))
con = input("Would you like to continue? [y/n]")
price = float(sum(AMT + AMT))
More information about the Tutor
mailing list