OBJECT ORIENTED
PROGRAMMING
Using python
PRACTICALS
SUBMITTED TO - Prof.Dr.Arpita Sharma
SUBMITTED BY:-
NAME=RAHUL KUMAR
ROLL NO=24HCS4165
COURSE=BSC (H) COMPUTER SCIENCE
COLLEGE:-DEEN DAYAL UPADHYAY COLLEGE
Practical1. WAP to find roots of
quadratic equation
Output
Practical.2 WAP to accept a number
“n” and analyze for prime numbers.
Output:
Practical.3 WAP to create a pyramid of
character “*” and reverse pyramid.
Output:
Practical.4 WAP to accept a character
and analyze character.
Output:
Practical.5 WAP to perform operations
on a string.
Output:
Practical.6 WAP to swap the first n
characters of two strings.
Output:
Practical.7 WAP to accept two strings
and returns the indices of all
occurrences of second string as a list. If
the second string is not present in the
first string then it should return-1.
Output:
Practical.8 WAP to create a list of the
cubes of only the even integers
appearing in the input list by using .
A . ”for” loop
B . list comprehension
Output:
Practical.9
Practical.10 WAP to create class point
with x and y as attributes and define a
method to find distance between two
points.
output:
Practical.11 WAP to print a dictionary
where the keys are numbers between 1
and 5 and the values are cubes of the
keys.
Output:
Practical.12 WAP to perform folloeing
operations .
T1=(1,2,5,7,9,2,4,6,8,10)
Output:
Practical.13 WAP to accept name from
user .raise and handle appropriate
exception(s) if the text entered by the
user contains digits and/or special
characters .
Output: