pwp merged qp
pwp merged qp
21222
3 Hours / 70 Marks Seat No.
15 minutes extra for each hour
Marks
P.T.O.
22616 [2]
Marks
2. Attempt any THREE of the following: 12
a) Write a program to print following :
1
1 2
1 2 3
1 2 3 4
b) Explain four Buit-in tuple functions python with example.
c) Explain how to use user defined function in python with
example.
d) Write a program to create class EMPLOYEE with ID and
NAME and display its contents.
iii) >>> t1 = [ 3, 5, 6, 7 ]
>>> print ( t1 [2] )
>>> print ( t1 [–1] )
>>> print ( t1 [2 :] )
>>> print ( t1 [ : ] )
Marks
P.T.O.
22616 [2]
Marks
2. Attempt any THREE of the following: 12
a) Describe Keyword "continue" with example.
b) Explain creating Dictionary and accessing Dictionary
Elements with example.
c) Explain any four Python's Built-in Function with example.
d) Write a Python program to find the factorial of a number
provided by the user.
Marks
P.T.O.
22616 [2]
Marks
2. Attempt any THREE of the following : 12
a) Explain membership and Identity operators in Python.
b) Write python program to display output like.
2
4 6 8
10 12 14 16 18
c) Explain four built-in list functions.
d) Write python program using module, show how to write and
use module by importing it.
Marks
1.
Attempt any FIVE of the following: 10
a) Enlist any four data structures used in python.
b) Give membership operators in python.
c) Write syntax for a method to sort a list.
d) Write use of matplotlib package in python.
e) What is data obstruction and data hiding.
f) Write the syntax of fopen.
g) What is dictionary?
P.T.O.
22616 [2]
Marks
2.
Attempt any THREE of the following: 12
a) Explain with example:
i) Indentation
ii) Variables
b) Print the following pattern using loop:
1 0 1 0 1 0 1
1 0 1 0 1
1 0 1
1
c) 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.
d) Describe following Standard Packages
i) Numpy
ii) Pandas
3.
Attempt any THREE of the following: 12
a) 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)
b) Write a python program that takes a number and checks
whether it is a palindrome.
c) Write a python program to create a user defined module that
will ask your program name and display the name of the
program.
d) List data types used in python. Explain any two with
example.
22616 [3]
Marks
4.
Attempt any THREE of the following: 12
a) Compare list and tuple (any four points).
b) Write a python program takes in a number and find the sum
of digits in a number.
c) Write a program function that accepts a string and calculate
the number of uppercase letters and lower case letters.
d) Write a python program to create class student with roll-no
and display its contents.
e) Explain following functions with example:
i) The open( ) function
ii) The write( ) function
5.
Attempt any TWO of the following: 12
a) Write the output for the following if the variable course =
“Python”
>>> course [ : 3 ]
>>> course [ 3 : ]
>>> course [ 2 : 2 ]
>>> course [ : ]
>>> course [ -1 ]
>>> course [ 1 ]
b) Write a python program to generate five random integers
between 10 and 50 using numpy library.
c) Write a Python program to create a class ‘Diploma’ having
a method ‘getdiploma’ that prints “I got a diploma”. It
has two subclasses namely ‘CO’ and ‘IF’ each having a
method with the same name that prints “I am with CO
diploma” and ‘I am with IF diploma’ respectively. Call
the method by creating an object of each of the three
classes.
P.T.O.
22616 [4]
Marks
6.
Attempt any TWO of the following: 12
a) Explain multiple inheritance and write a python program to
implement it.
b) Write a Python program to create user defined exception that
will check whether the password is correct or not.
c) Describe various modes of file object. Explain any three in
detail.
22616
12425
03 Hours / 70 Marks Seat No.
Marks
P.T.O.
22616 [2]
Marks
2. Attempt any THREE of the following: 12
a) Explain decision making statements if-else, if-elif-else with
example.
b) Describe any four methods of list in Python.
c) Write a program illustrating use of user defined package in
Python.
d) Describe various modes of file object? Explain any two in
detail.
Marks
P.T.O.
22616 [2]
Marks
2. Attempt any THREE of the following: 12
a) Describe bitwise operators in Python with example.
b) Write any four methods of dictionary.
c) What is local and global variables? Explain with appropriate
example.
d) Write python program to illustrate if else ladder.