Create a Python class called BankAccount
that simulates a simple bank account. The class should have the following functionalities:
- It should have a constructor that accepts the
account_holder
name and initial balance (initial_balance
), setting the balance to zero if the initial balance is not provided. - A method called
deposit
that accepts an amount and adds it to the account balance, and then returns the updated balance. - A method called
withdraw
that accepts an amount and subtracts it from the account balance, returning the updated balance, but only if there are sufficient funds in the account. If there are insufficient funds, it should print an error message and leave the balance unchanged. - A method called
get_balance
that returns the current account balance. - A method called
get_account_holder
that returns the name of the account holder.
- brand
- name
- color
- capacity
- plate_number
- drive() prints "the vehicle_name is driving!"
- drift() prints "the vehicle_name is drifting !!" or something else depending on the class.
- carry_cargo() prints "the vehicle_name is carrying cargo !!" or something else depending on the class
- Bus
- Truck
- override the methods as needed for each subclass of vehicle.
- create at least one object of each class.
- call all the methods on each object.