Python Practical Questions
Python Practical Questions
10) Write a program to check the largest number among three numbers.
13) Write a program that takes the marks of 5 subjects and display the grade.
* *
* * *
* * * *
15) Write a program to print all even numbers between 1 to 100 using while loop.
16) Write a program to find sum of first 10 natural numbers using for loop.
20) Write a program that takes in a number and finds the sum of digits in a number.
21) Write a program that takes a number and checks whether it is a palindrome or not.
22) Write a program to sum all the items in a list.
28) Write a program to create a tuple and find minimum and maximum value of a tuple.
29) Write a program to create a set, add members in set and remove one from it.
30) Write a program to perform set operations like intersection, set difference, symmetric
32) Write a program to combine two dictionary adding values for common keys.
33) Write a program that accepts a string and calculate the number of upper case letters
34) Write a function that takes a number as a parameter and check number is prime or not.
36) Write a program to create a user defined module that will ask your college name and
37) Write a program that will calculate area and circumference of circle using inbuilt
Math module.
39) Write a program to create a class to print an integer and a character with two methods
having the same name but different sequence of integer and character parameters.
40) Write a program to create a class to print the area of square and rectangle. The class
has two methods with the same name but different number of parameters. The method
of printing area of rectangle has two parameters which are length and breadth
respectively while the other method for printing area of square has one parameter
41) Write a program to create a class ”Degree” having methods ‘getDegree’ that prints “I
got a degree”. It has two subclasses namely ‘Undergraduate’ and ‘Postgraduate’ each
Postgraduate” respectively. Call the method by creating an object tof each of three
classes.
42) Write a program to create a class Employee with data members: name, department,
and salary. Create suitable methods for reading and printing employee information.
43) Write a program to read and print student information using two classes using simple
Inheritance.
46) Write a program to create user defined exception that will check whether the
49) Write a program to create two matrices and perform addition, subtraction,
54) Write GUI program to import Tinkter package and create a window and set title.
56) Write a program to read contents of abc.txt and write same content to pqr.txt.
57) Create a class Student with data members name, roll number and address. Create a
58) Create a parent class named Animals and a child class Herbivorous which will extend
1 2
1 2 3
1 2 3 4
60) Write a program for importing module for addition and subtraction of two numbers.
61) Write a program to create dictionary of student that includes their ROLL NO and
NAME.