Name : Deepak Prakash Deore Sign :-
Roll no :- 57 Date :- / / 2025
Branch :- Second Year B.Tech (IT)
Sub:- Python Lab
Remark :-
Exp. No:- 01
Title : Write a python program to understand class , object and functions.
# Defining a class class
Student:
def _init_(self, name, age):
self.name = name
self.age = age
def display_info(self):
print(f"Student Name: {self.name}, Age: {self.age}")
# Creating an object
student1
Student("John", 20)
student1.display_info()
# Defining a function def
square(num):
return num * num
print("Square of 5:",square(5))
Output:
Student Name: John, Age: 20
Square of 5: 25