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

Python I-Scheme Prelims Paper[1]

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Python I-Scheme Prelims Paper[1]

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Diploma Preliminary Examination

Subject : TyDiploma (Sem-6) – Python-I-Scheme


70 Marks Time : 3 hrs

1. Attempt any FIVE of the following: 10 Marks


a) List features of Python.
b) Enlist any four data structures used in python.
c) List membership operators in Python.
d) Compare list and Tuple.
e) What is data abstraction and data hiding?
f) How to give single and multiline comment in python?
g) List different modes of opening file in python.

2. Attempt any THREE of the following: 12 Marks


a) Explain how to use user defined function in python with example.
b) Write a Python program to find the factorial of a number provided by the user.
c) What is local and global variables? Explain with appropriate example.
d) Write a program to print following
1
12
123
1234

3. Attempt any THREE of the following: 12 Marks


a) List Data types used in python. Explain any two with example.
b) 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)
c) Explain method overloading and overriding in python.
d) Explain how try-catch block is used for exception handling in python.

4. Attempt any THREE of the following: 12 Marks


a) Explain decision making statements If-else, if-elif-else with example.
b) Explain use of format() method with example.
c) Write python program to read contents of abc.txt and write same content to pqr.txt.
d) Explain Numpy package in detail.
e) Write a python program to create class student with roll-no and display its contents.

5. Attempt any TWO of the following: 12 Marks


a) Write a Python Program to check if a string is palindrome or not.
b) Write python program to perform following operations on Set:
i. Create set
ii. Access set Element
iii. Update set
iv. Delete set
c) Write the output of the following:
Diploma Preliminary Examination
Subject : TyDiploma (Sem-6) – Python-I-Scheme
70 Marks Time : 3 hrs

i. >>> a = [2, 5, 1, 3, 6, 9, 7 ]
>>> a [ 2 : 6] = [ 2, 4, 9, 0]
>>> print (a)
ii. >>> b = [ “Hello” , “Good” ]
>>> b. append ( “python” )
>>> print (b)
iii. >>> t1 = [ 3, 5, 6, 7 ]
>>> print (t1 [2])
>>> print (t1 [–1])
>>> print (t1 [2 :])
>>> print (t1 [:])

6. Attempt any TWO of the following: 12 Marks


a) List and explain any four built-in functions on set.
b) With suitable example explain inheritance in Python.
c) Design a class student with data members: name, roll no., department, mobile no. Create suitable methods for
reading and printing student information.

You might also like