0% found this document useful (0 votes)
54 views2 pages

Nov Dec Makeup 2023 - Compressed

The document outlines an examination for a B.E./B. Tech. degree in Python programming scheduled for December 2023, consisting of various modules and questions. Students are required to answer five full questions, selecting one from each module, covering topics such as data types, functions, file handling, and object-oriented programming. The exam has a total duration of three hours and is graded out of 100 marks.

Uploaded by

Kangana W. M
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)
54 views2 pages

Nov Dec Makeup 2023 - Compressed

The document outlines an examination for a B.E./B. Tech. degree in Python programming scheduled for December 2023, consisting of various modules and questions. Students are required to answer five full questions, selecting one from each module, covering topics such as data types, functions, file handling, and object-oriented programming. The exam has a total duration of three hours and is graded out of 100 marks.

Uploaded by

Kangana W. M
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

~Of$

,
'
.,,--~,'~-~ ~
•; 1; -l·••1.
•.

-
usN Q //////I I I • ·:~ ( :W.~c~~}B1 BPLCKB2os
Second s " t!~~~
eme ster B.E./B. Tech. Degree Exa,in1'i__a'm~ ~./Dec. 2023
Time· 3 hr Introduction to Python Pr:d!jra--mming
• s. 'a Max. Marks: 100
Note· l A 1'-'...
• • nswer any FIVE full questions, choosing ONE full question fro,n each module.
.
2 • M·Miarks, L
: Bloom's level, C: Course_,o?itcomes.
,.
M L C
Q.1 a. De Module l )

monstrate with example print(), input~) and fonnat ( ). 5 Lt COl


b. Explain d' • . ... . . • 7 L2 cot
con thonal branchmg statements with syntax and wnte a suitable
program for the same. <)i ,
c.
Write a python program t6 !"
ck whether a given num!,~ is Armstrong or
not. [Hint - An Armstrong..µ mber is any number otn digits which is equal
8 L3 COl

to the su f th .. ., •
m o n p~ep cff digits in the number=,.Fo'r example, 371 ts an
Armstrong numbe,4}J%e 3**3 + 7**3+1 ** 3 = 371]
(:"' \ ~
, ,.._ OR ~t ~,
Q.2 a. Write a ~Yjllo~~rogram to guess the secr1t rl~mber between 1 to 25 within ' 8 L3 cot
5 guess ~~umber is same then it~,dght guess else wron&_ guess.
,,("~ ~ •
b .• What are ~user defined function? 'How can we pass th~,.arguments to the 6 Lt COi
functions? Explain with suitableexamples. ·f I··
'Ti'
~'

. ~ '(r ,-J "

c. What are compari~on an~dblean operators~? citr all the comparison and 6 Lt COi
Boolean operators m python.
, I ~
" .

,-~~ Module-~., l
~

Q.3 a. Explain the metMls'of list data typ~~ ~hon for the fol!owing operation 8 LI CO2
with suitable c~,ie~nippets for each. \ "{;J,1,-
i) Add~alues to a list -::", , , 1,
ii) R~DJO~g value_s fro~ a(I1t
iii) Fi~ng a value 1n ~h -
,
iv) Sbrtmg the values ~
~ ...
E.~lain the concept <!~\st slicing and list traversing with an example.
b ., ~ 6 Lt CO2
t .. ,. ,
c. ~0 Wri~e a pyJ~-program to count occurrences of
What is a die~· 6 L3 CO2
characters ~-{ g and pnnt th~ t.
- _ ¥ OR
Write a python program ~~d the missing nu1nber from the given a list 10 L3 CO2
Q.4 a.
n-1 numbers ranging f r ~ ton, There are no duplicates (Hint - eg : Input
= 1 2 4 6 3 7 8, output :))
...
~

How is triple di[{IJepffrom li~t( )?_ Expl_ain with example the function used 6 Lt CO2
b.
to convert list int~iple and tnple into hst.

Explain i~ert() and remove( ) 1nethods of list with exa1nple. 4 LI CO2


c.
"'
l of2
BPLCK 205B/ BPLC!<Jl ...._.
. '( ·. . ios
. ..~·· ,. -- "'
Module 3
· fl" • file • 5 r:--
Q.5 a. Write. cf python program to count number o 1nes ID a LJ~
'
r-::-- l
10
b. Explain the following functions with example_: . . ~ b LI~
i) makedirs( ) ii) getcwd( ) iii) velpath( ) 1v) hstdrr( SU ( )

c. What are thre: •"mode" arguments that can be pa~ssed• to open( ) function
5 it ~
with exa1np le.
OR •
....
y --
u,sing the shelve mod~an d 6 L21Coi'
Q.6 a. W_ith code snippet, explain saving variah~s
print pfonnat( ) functions.
L3-
b. Write a python program that accepts 'a sentence and find the~,...l!_umber of
7
~
words, digits, upper case letters and lciwer case letters.
c. Write a program to make a new string with all the cons~ah t eliminated
7 L3 ~
from the string read from the user [Hint_ For exampl~Im?ut: Hello, have a
good day. Output : HII, hv grudy] ~
,,
Module 4 ,
Q.7 a. What is meant by compressing Files? Exp~ reading, extracting and 10 LI C01
creating 21 P files with an example.
b. Define assertions. What does an assert st~nient in python consists of? 5 LI CO2

c. How does OS. walk( ) work in p)'!hon?' "


~~
-.. 5 L3 C03
;
-
, OR A~- .,

~
7
..
Q.8 a. Discuss the basicConfig( )~ethod to confi~,ille lagging w an L2 CO2
example. 'ti
~

b. Write a program to depict Raising Exception.


y 7 Ll CO2
, ~
\
.,
'\
~

c. Explain the functions-Bf Shutil module with(:example. 6 L2 CO2


'•!
. ' ,, I
Module -5
Q.9 a. Compare the difference between ~s, static and instan~e thod. 6 L2 C04
. ~
b. Define classes and objects in,p};thon . Create a c~ss "called Employe e and 9 L2 C04
initialize it with employee id Jd name. Design method to :
i) Set Age - to assign age to the emplo}ltg ~
ii) Set Salary - to assign salary to the empl~yee
iii) Display- to display all information ~f the employee.
Ii

Explain ---- init ---- and str --- methed(\vtth an example. 5 L2 C04
c.
OR
~
-
Write a program to imple1nent polymorp hism in python using method 7 L3 co4
Q.10 a.
overridin g.

Define pure function? Give an example program that returns square of a 7 L3 co~
b.
passed integer.
L2 co~
c. How class can be instantiated in python? Write a python program to 6
instances as return values to define a class RECTANGLE with member
width. Height cornerX cornerY and 1nember function to find center area
and perimeter of a rectangle. __,,
L .
*****
2 of2

You might also like