American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Python OOP – Bill

May 17, 2022 @ 5:00 pm - 6:00 pm

Today We:
  1. Set Up Pycharm for use
Your HW:
  1. Open your car class file
  2. Make a max_gas_tank atribute that needs to be in the __init__ function
  3. Make it so the gas_tank default atribute cannot be greater than the max_gas_tank attribute in the fill_gas_tank method
  4. Create another new atribute, miles_per_gallon, that also needs to be in the __init__ function
  5. 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.
  6. Make sure that anytime you created a new car to specify the new max_gas_tank attribute and the miles_per_gallon attribute.

Details

Date:
May 17, 2022
Time:
5:00 pm - 6:00 pm
Verified by MonsterInsights