F Paython lesson 9 - IGAF

IGAF

The purpose of india google all farmate is to provide information related to news, education, technology, general information, general knowledge, mponline vacancy government rdvv admission, counselling, course, computer, virus,mobile,latest bharti news, information local, AI artificial intelligent


Wikipedia

Search results

indiagoogleallfarmate.com

Translate

Monday, June 9, 2025

Paython lesson 9

Python Lesson 9 - Object Oriented Programming

Python Lesson 9 - Object Oriented Programming

🌟 Introduction to OOP in Python

OOP (Object Oriented Programming) is a method of structuring a program by bundling related properties and behaviors into individual objects.

📘 Python Class Example



class Student:

    def __init__(self, name, grade):

        self.name = name

        self.grade = grade

    def display(self):

        print(f"Student Name: {self.name}")

        print(f"Grade: {self.grade}")

# Creating object

student1 = Student("Rahul", "A")

student1.display()

    

🧠 Key Concepts

  • Class - Blueprint for creating objects
  • Object - Instance of a class
  • Constructor - __init__ method used for initialization
  • Methods - Functions defined in class

📌 Output



Student Name: Rahul

Grade: A

    

No comments:

Post a Comment

thank to you

Note: Only a member of this blog may post a comment.

india google all farmate

india google all farmate
IGAF

Dibble click

Followers

Featured Post

Adobe New AI Tools 2026 Premiere + After Effects

Adobe Premiere Pro & After Effects New AI Tools 2026 – Full Hindi Tutorial 🎬 Adobe Premiere Pro & After...