Python Practical Exam
Python Practical Exam
2) Write a Python program to find the factorial of a number provided by the user.
3) Write a python program to input any two tuples and interchange the tuple variables.
6) Write a Python program to calculate sum of digit of given number using function.
7) Write a Python Program to accept values from user in a list and find the largest number and
smallest number in a list.
8) Design a class student with data members : name, roll no., department, mobile no. Create
suitable methods for reading and printing student information.
13) Write a program function that accepts a string and calculate the number of uppercase letters
and lower case letters.
14) Write the output for the following if the variable course = “Python”
>>> course [ : 3 ]
>>> course [ 3 : ]
>>> course [ 2 : 2 ]
>>> course [ : ]
>>> course [ -1 ]
>>> course [ 1 ]
15) Write a python program to generate five random integers between 10 and 50 using numpy
library.
16) Write a Python program to create user defined exception that will check whether the
password is correct or not.
17) Write the output for the following if the variable fruit = ‘banana’.
>> fruit [:3]
>> fruit [3:]
>> fruit [3:3]
>> fruit [:]
18) Write python program to display output like.
2
4 6 8
10 12 14 16 18