0% found this document useful (0 votes)
11 views

Python 4 Lab

The document is a Python lab report by Deepak Prakash Deore, focusing on understanding classes, objects, and functions in Python. It includes a class definition for 'Student' with methods to display information and a function to calculate the square of a number. The output demonstrates the functionality of the class and the square function.

Uploaded by

wafflerick69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Python 4 Lab

The document is a Python lab report by Deepak Prakash Deore, focusing on understanding classes, objects, and functions in Python. It includes a class definition for 'Student' with methods to display information and a function to calculate the square of a number. The output demonstrates the functionality of the class and the square function.

Uploaded by

wafflerick69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like