Roll No qn1f/074
SEM-IV Diploma Exam 2023 (Even)
(Computer Science & Eneineering) (Theory)
(Time: 3:00 Hours] Python Programming (2018404) [Max. Marks: 70]
All questions are compulsory. (HH YA 3G{n
Marks are mentioned on the right side of each auestinn (3j F uMo a
3Rifcba f )
Group (A) q4 -4)
Q.1 Choose the most suitable answer from the following options. (1*20-20).
In which year was the python language developed?
(a) 1995 (6) 1972, (c) 1981 (d) 1989
ii. In which languáge is python written?
(a) English (as) ) PHP (yen () cfh (d) All of the above (34 TÌ)
What do we use to define a block of a code in pythön language?
(a) key (ar (b) Brackets (PBO)
c) Indentation GRIv)
() None ofthese. (3-1-o T)
iv. Which character is' used in python to make a single line comment?
(a)/ (b) / (c) # d) !
What is the methodinside the class in python language?
(a) Object (GTate) (b) function (bg) (c) Atribut (faiNGI (a) Argument (46)
vi. Which of the following declarations is incorrëct?
(a) -x -2 (b)--> (C)-- xyz=5 (d) None of these. ($- S Ì)
vi. What is the éxtension of python file?
(a).py (b) -python (c).p (a) None of these (SAH )
viii. Which of the following is not a keyword
in pythn languages.
(a) Val (c)
(b) raise () with (fY)
(c) try C5) ()
x. Which of the following words cannot
bea variable in python languag
(a) -val
(6)val (d)-try
(c) try
Page 1 of4 (2018404)
471F7640B45A23OFZS11C2438ECAB035
current option for power
Which of the following operators is the (ab)?
a ** b (c) a M b
(a) a Ab (b) (d) a A* b
xi. Which one of the following has the highest preccdcnce in the expression?
(a) Division (tà4T9-) (b) Subtraction (ê) (c) Power (IÍT)
() Parentheses ()
xü. Which of the following fuctions is a built in tunction in python langage?
(a) Val () (b) print (0 (c) printf ( (a) None of these ($-1
ak T
xiii. Which of the following is correctly eyaluated for this function? Pow (xiy.2)
(a) (* ** y)Z (b) (x/y) *z (c) (***y)%2.
xiY. What will be the output of this statements
>"at be"
(a) a+bc (b) abe (c) a b,c
All keywòrds in python are in
(a) Capitalized (b) Lower case. (c) Uppercase (d) None
of the mentioned.
(G4T )
xvi. Which of the following character is used to give single-line comments in python?
(a) l/ (b) #
(c)
!
(a)/*
xvii. Which of the following functions can help us to find thè version
of python that we are currently working
on?
ic) [Link]
(a) [Link](1) (b) [Link] (0) 0: (d) [Link]
xvii. What will be the output of the following python function? Leñ ([hello",2,4,6]1)
(a) Eror .
(b) 6 (c) 4 (d) 3
xix. What will be the output of the following python code sipped? For i in [1,2,3,4] [:
-1|: print G)
(a) 4 3
(AHIcdG YqA
21
os f
o
3AIJCYT l For in [1,2,3,4] -1]: print (i)
i
? [:
(b) error (c) 1 234
() None ( TE)
XX. Which one of the following is nt a keyword in python language?
(a) pass (b) eval (c) assert
(d) nonlocal.
Page 2 of 4
(2018404)
471F7640B45A230OF TSIIC3438ECAB035
Group (B) gu-4)
Q.2 Discuss python and its history.
OR (A)
Discuss the process of declaration of variables in6vhon
Q.3 Discuss python name spaces.
OR(3YGI)
Discuss the use of help ) and dict () functions in pythen.
Q.4 Differentiate between litand tuples in lython.
OR (3G)
Discuss the advåntages ofpython. 4
Q.5 Define slicing in python with the help of example.
OR (3YTT)
Discuss keywords inpython. 4
.Q.6 Diferentiate btween local and global variables in python: 4
OR (3d)
Discuss rcad function in python. 4
Group (C) QY- )
of code.
Q.7 Define function in python with the help 6
OR (3FY)
Discus conditional statementin python in detail.
6
Page 3 of 4
(2018404)
AM1
0.8 Write a progran in pytlon to find out the nnxinnI Hunler in a riven pythorn lint.
OR (3F4)
Diflerentiate between for loop ond vhile loop, 6
Q.9 Writc a python program to swap two nimbers using function,
OR (34dT)
Discuss differcnt string opcrations with ihe help, of oxamples in python.
6
Q.10 Discuss the common. Built in data typcs in python.
OR(ŠTYA)
Write a python program to print factorial of a number, 6
Q.11 Write notes on followings 6
a) Module.
b) Write function in,python file.
OR (3TT)
Write notes on followings.
a) Web 2py
by regex
kk