Name : Deepak Prakash Deore Sign :-
Roll no :- 57 Date :- / / 2025
Branch :- Second Year [Link] (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):
[Link] = name
[Link] = age
def display_info(self):
print(f"Student Name: {[Link]}, Age: {[Link]}")
# 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