Answered step by step
Verified Expert Solution
Link Copied!

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! image text in transcribed
\#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions