Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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: ")
how do you fix this code to do the average spent on gas each week?? Please help!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started