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

Python Practical Exam

The document is a question bank for an internal practical exam scheduled for April 19, 2025, covering various Python programming topics. It includes questions on dictionaries, factorial calculation, tuples, user-defined exceptions, palindromes, list operations, class design, inheritance, set operations, string manipulation, random number generation, and output formatting. Each question requires the implementation of specific Python programs or explanations of concepts.

Uploaded by

n96m9vc98b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Python Practical Exam

The document is a question bank for an internal practical exam scheduled for April 19, 2025, covering various Python programming topics. It includes questions on dictionaries, factorial calculation, tuples, user-defined exceptions, palindromes, list operations, class design, inheritance, set operations, string manipulation, random number generation, and output formatting. Each question requires the implementation of specific Python programs or explanations of concepts.

Uploaded by

n96m9vc98b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

TYCO A+B+C

Question Bank for Internal Practical of PWP ON 19/4/2025


1) Explain creating Dictionary and accessing Dictionary Elements with example.

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.

4) Write a program to show user defined exception in Python.

5) Write a Python Program to check if a string is palindrome or not.

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.

9) With suitable program explain inheritance in Python.

10) Print the following pattern using loop:


1010101
10101
101
1
11) Write python program to perform following operations on set. i) Create set of five elements
ii) Access set elements iii) Update set by adding one element iv) Remove one element from
set.

12) What is the output of the following program?


dict1 = {‘Google’ : 1, ‘Facebook’ : 2, ‘Microsoft’ : 3}
dict2 = {‘GFG’ : 1, ‘Microsoft’ : 2, ‘Youtube’ : 3}
dict1⋅update(dict2);
for key, values in dictl⋅items( ):
print (key, values)

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

19) Write output of following:


T = (‘spam’, ‘Spam’, ‘SPAM!’, ‘SaPm’)
print (T[2])
print (T[-2])
print (T[2:])
print (List (T))

You might also like