Question: how do you fix this code to do the average spent on gas each week?? Please help! #Display name/class print(name class date) #Display name of
\#Display name/class print("name class date") \#Display name of program print ("Monthly Gas Expense") \#Initalize variables sum =0.0 sentinel = "complete" print("Enter the amount spend on gas (type 'complete' to finish):") weeklyTotal = input () \#create loop until sentinel is entered while weeklyTotal I= sentinel: sum += float (weeklyTotal) \#prompt user for input print("Enter the amount spend on gas (type 'complete' to finish):") weeklyTotal = input() \#display results print("Your monthly total is:", sum) print("Your average spent on gas each week is: ")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
