American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

4:30 PM – Python OOP – Gamas

April 26, 2022 @ 4:30 pm - 5:30 pm

Today We Do
  1. We continued with MonsterInheritance project.
Homework
  1. Inside your MonsterInheritance project, create car.py
  2. Copy only Car class codes from page 168 into car.py.
  3. Create electric_car.py and copy only ElectricCar class codes from page 168 into electric_car.py. On the top of this file, import Car class. Look at how we import Monster class inside MonsterInheritanceMain class.
  4. Inside car.py, add a new method: fill_gas_tank. A method is a function inside a class.
  5. Inside fill_gas_tank method, print “The gas tank for this car is filled up”.
  6. Create a new instance of Car class and call the fill_gas_tank method.

Details

Date:
April 26, 2022
Time:
4:30 pm - 5:30 pm
Event Categories:
,
Verified by MonsterInsights