Question: code using Python 3 see pic and answer TODO in red. class Car: det init (self,x): if len(x) 13: raise Exception(NOT CREATED CORRECTLY self.mpgexte) self.tank

code using Python 3
see pic and answer "TODO" in red.
 code using Python 3 see pic and answer "TODO" in red.
class Car: det init (self,x): if len(x) 13: raise Exception("NOT CREATED CORRECTLY

class Car: det init (self,x): if len(x) 13: raise Exception("NOT CREATED CORRECTLY self.mpgexte) self.tank Capacity (1) self.curras [2 dot travelMilesiselt, siles): If possist > currentfuel/capacity exler Car (30)7/18 gallons main ass Cainit 3: class Car: def __init__(self, *x): if len(x) !=3: raise Exception("NOT CREATED CORRECTLY") self.mpg=x[0] self.tank Capacity = x[1] self.currGas = [2] def travelMiles(self, miles): possDist = self.mpg*self.currGas if possDist =0 # TODO: Add in refuel car function, that fills the tank to capacity def __str__(self): return "Car (0) 0/1) gallons".format(self.mpg, self.currGas, self.tank Capacity) def main(): pass # TODO ADD CODE HERE # Ask the user for the tank size of their car and its mpg rating, #create an instance of that car and make sure the tank is full #(DO NOT USE REFUEL FUNCTION, initialize as full) # Travel 5 miles # Print out the car in the format: Car () current fuel/capacity #example: "Car (30) 7/18 gallons" # Refuel Tank # Travel 1000 miles # Print out the car in the format: #Car () current fuel/capacity #example: "Car (30) 7/18 gallons if -_name__-..._main__": main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!