« All Events
5 PM – Python OOP – Bill
May 17, 2022 @ 5:00 pm - 6:00 pm
Today We:
- Set Up Pycharm for use
Your HW:
- Open your car class file
- Make a max_gas_tank atribute that needs to be in the __init__ function
- Make it so the gas_tank default atribute cannot be greater than the max_gas_tank attribute in the fill_gas_tank method
- Create another new atribute, miles_per_gallon, that also needs to be in the __init__ function
- Make it so in the drive method, instead of dividing the distance by 50 for the gas_consumption variable, divide the distance by the miles_per_gallon attribute.
- Make sure that anytime you created a new car to specify the new max_gas_tank attribute and the miles_per_gallon attribute.