F Paython lesson 9 - INDIA GOOGLE ALL FARMATA

INDIA GOOGLE ALL FARMATA

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

Translate

09 June, 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

india google all farmate

india google all farmate
IGAF