PythonProgramming 22PLU105B Modelquestion Paper 2
PythonProgramming 22PLU105B Modelquestion Paper 2
22PL
USN
U105B
B. E. First Semester End Examination (SEE), 2022-23
Model Paper-2
Introduction to Python Programming
[Time:
3
[ Maximum Marks: 100]
Hours
]
NOTE
:
Answe
r ANY
ONE
full
questi
on as
per
the
choice
given
below.
Q. No. Questions Marks CO RBT
(a) Discuss the features of python program and different data types in
[10 Marks] CO1
1 python with examples
(b) explain basic input output statement in python [04 Marks] CO1
(c) Write a python program to predict given number is prime or not
[06 Marks] CO1
prime.
OR
2. a) Define Identifiers. Explain rules to define an identifier in python. [04 Marks]
CO1
b) Discuss arithmetic operator, logical operator, comparison operator, [10 Marks]
assignment operators in python with suitable examples CO1
c) Develop a Program to Prompt for a Score between 0 to 100. If the [06 marks]
score Is Out of Range, Print an Error. If the Score Is between 0 to
100, Print a Grade Using the Following Table
Score grade
100 – 90 O CO1
89 - 66 A
65 - 58 B
57 - 51 C
50 - 40 pass
< 40 Fail
3. a) Explain with proper syntax function definition in python. Write a [6 marks]
program to explain defining default parameters in function. CO2
b) Explain slicing and negative slicing with examples with respect to [6 Marks]
strings CO2
OR
4 a) Develop a program to find the sum and average of numbers using [6 Marks]
functions CO2
b) Write the code snippet and output for the following string methods [10 marks]
CO2
i)join ii)split iii) count iv)lower and upper v) swapcase
c) Discuss the list in python with suitable examples [04 Marks] CO3
OR
c) Explain any four dictionary methods with code snippet and output [8 Marks] CO3
7 a) Describe sets in python. Illustrate with python a code to create a set [10 Marks]
and perform the following operations on sets.
i. an intersection
ii. union CO3
iii. set difference
iv. Symmetric difference of sets.
b) Explain tuples with suitable examples [4 Marks] CO3
c) Develop a python program to identify number of vowels, consonants, [6 Marks]
special characters and digits in a given file. CO4
OR
8 a) Discuss the different file access modes with examples [10 Marks] CO4
b) Explain and four basic operations of Tuples with proper examples. [6 Marks] CO3
c) Explain the different reading methods with respect to files [4 Marks] CO4
9 a) Discuss try-catch-finally with examples [08 Marks] CO4
b) Discuss the features of oops [6 Marks] CO5
c) Explain constructors in python with example? [6 Marks] CO5
10 a) Explain the classes and objects with examples [10 Marks] CO5
b) Differentiate between error and exceptions? Write a Python program [10 Marks]
which will throw exception if the value entered by user is less than CO4
zero.