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(in
On 20Apr2019 16:51, Ju Bo wrote:
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
On Sat, Apr 20, 2019 at 04:51:11PM -0400, Ju Bo wrote:
> 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))
That's a good first attempt.
Rather than set
On 20/04/2019 21:51, Ju Bo wrote:
> 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.
Your code very nearly does that, it just needs a slight tweak.
> I'm havi