Course Content
Introduction to Programming and Python
Overview of Python History and evolution Python’s features and benefits Set-Up Development Environment Installing Python and IDE (e.g., PyCharm, VS Code) Writing and running your first Python program Hands-On Activity Write a simple Python program to display “Hello, World!”
0/3
Structure Of A Python Program
A comprehensive overview of the structure of a Python program, covering essential concepts efficiently.
0/1
Basic Syntax and Control Statements
Basic Syntax Structure of a Python program Data types, variables, and operators
0/3
Object-Oriented Programming (OOP)
0/3
Python Programming For Beginners
About Lesson

Design a Class for a Simple Banking System

  • Objective: Design a class to represent a simple banking system with attributes like account number, account holder name, and balance. Include methods for depositing and withdrawing money.
  • Steps:
    1. Define the BankAccount class with attributes and methods.
    2. Create objects of the BankAccount class and perform operations.

    python

    class BankAccount: def __init__(self, account_number, account_holder, balance=0): self.account_number = account_number self.account_holder = account_holder self.balance = balance def deposit(self, amount): self.balance += amount print(f"Deposited {amount}. New balance is {self.balance}") def withdraw(self, amount): if amount <= self.balance: self.balance -= amount print(f"Withdrew {amount}. New balance is {self.balance}") else: print("Insufficient funds") account = BankAccount("123456", "John Doe", 1000) account.deposit(500) account.withdraw(200)

Implement Inheritance with a Base Class and Derived Classes

  • Objective: Implement inheritance by creating a base class and derived classes. For example, create a base class Vehicle and derived classes Car and Bike.
  • Steps:
    1. Define the Vehicle base class with common attributes and methods.
    2. Define the Car and Bike classes that inherit from Vehicle.

    python

    class Vehicle: def __init__(self, make, model, year): self.make = make self.model = model self.year = year def display_info(self): print(f"{self.year} {self.make} {self.model}") class Car(Vehicle): def __init__(self, make, model, year, doors): super().__init__(make, model, year) self.doors = doors def display_info(self): super().display_info() print(f"Doors: {self.doors}") class Bike(Vehicle): def __init__(self, make, model, year, type): super().__init__(make, model, year) self.type = type def display_info(self): super().display_info() print(f"Type: {self.type}") car = Car("Toyota", "Corolla", 2020, 4) bike = Bike("Yamaha", "MT-07", 2021, "Sport") car.display_info() bike.display_info()