0 ratings0% found this document useful (0 votes) 119 views2 pagesVtu Python QP 2023 Odd
Previous year question paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
@3es ScHaHE
sy Pea ea eee Pee REDCK10SB/BPLCKBIOS
First Semester B.E./B.Tech, Degree Exami n, Jan./Feb. 2023
Introduction to Python Programming
Time: 3 hrs. ox Max. Marks: 100
Note: I. Answer any FIVE full questions, choosing@QNE. ‘full question from each module,
2,.M: Marks , L: Bloom's level, C: Course outcomes.
i Sa
? Tilustrate the rules of preg 6 | u2| COL
aoe 6 |L2 | col
c. | Develop a program to oO ibonacci sequence ae (N). Read N
| from the console.
Q.2 | a. | What are ae Explain me mgt parameters and return | 7 | L2 | COL
Mod:
1" Ta, | What is the need for role of precede:
| | | in Python with example.
b. | Explain the local and global wank
L3 | COL
statements.
Tb. | Define exgepjion handling. How exeeption¥are handled in python? Write a|7 | L2 | COI
prograih tO6lve divide by zero exception.
©. | Develap a python program to ao the area — and triangle L3 | Coli
print the result.
a
a}
[ae iz i Module —2
5 || Explain negative iden Sing, inn) < ), remove( 0, 8 | 12] coz
| | | Snser) and soa() with Stable exam, am.
b.| Explain the useofin and na Fr operons wih sab ples, |6 | 2 | coz
©. | Develop a proByam to find mean, var maser aria 6 |L3 | coz
1 4 ste
OR 3S
Q4 Ja Ex following methbds ja Tiss with an evans 8] 12] co2
i) len’ ii) sum() x() iv) min(). ¢
pee
By Explan $i) and aden Ynethod A onary. © |i2 | coz
TE | Develop a Pyihy ara isan campy oh TGIVeRTITIE © | 13 | coz
input: Java
output: jA Vay ‘
: | JAVGs QA
we Module—3
Explain join() and split( method with examples. 8 ] 12] cos
5
5: | Explain wit xamplehay aphal) Wisalnum() i isspacet ). €O3
te,
5
|
|Tevelop a pythen code to determife whether the given string is @
palindrome o fBta palindrome.
Cco3
, ror2OR
ae = BPLCK105B/BPLCKB105
Q.6 |a.| Explain the concept of file handling. Also explain reading and writing | 8 | L2 | CO3
process with suitable example. Rt
B. Explain the concept of file path, Also disdits absolute angiveTative file path. | 6 | L2 | COS
ce Briefly explain saving variables with shelve module. 6 | L3 | CO3
| |
Module +4
Q7 | a. | Explain the following file operations in PMhon with suitable example: <§ | 6 | L2 | CO3
ie j a
Copying files and folders ee
\ Moving files and folders . |
| Permanently deleting files and fold .
b. | List out the benefits oF compres fileMAiso explain reading of a zip file [8 | 12 | CO3
with an example. « -’ i
c. | List out the differenc jetween shutilicopy( ae shutil.copytree( )|6 | L3 | CO3
method. Sg x
OR Ea
Q8 |a. | Briefly explai ions and raising a c»8¢pifon. 6 | L2] co3
b. | List out the Benefis of using logging modul€ with an example. 6 | 12 | cos
c. | De aN program with a funiétion hamed DivExp which takes two|8 |L3 | CO3
paatinsters a, b and returns a vélye C (C|~ a/b). Write suitable assertion for
a> 0 in function DivExp and raisé an c}ception for when b = 0. Develop a
suitable program which reads two valfies from the console and calls a
function DivExp. :
cea ee eee e se =|
Q.9 | a. | Define a class aie construct the class called engi initialize | 8 | L2 | CO4
it with height~ 190, width = 200, starting point as (x = 0 ). Write a
program to ‘aes the center pees of a rectangle.
fe.
b. | Explaig'the concept of copying Using copy module, Ran example. 6 | L2 | Co4
ae v
c. Expl the concept oF inka with an example. 6 | L2 | Co4
¢ a, 3s
v on
Q.10 efine a function +h takes two objects. representing complex numbers | 8 | L2 | CO4
| and returns new,¢ lex number with a addition of two complex numbers.
Define a suitable class ‘Compléx’ to represent the complex number.
| Develop a program to read N(N > = 2) complex numbers and to compute
| the addition of N complex numbers.
b.| Explain _init__()and&_str__() method with examples. 6 | L2]Co4
¢. | Briefly explain the printing of objects With an examples. 6 | 12] Cos
IL :
+ a
*
fs