You are on page 1of 3

Writing anything except roll number on question paper will be deemed as an act of indulging in unfair means and

action shall be taken as per rules.


Roll No.: ……………..……
JODHPUR INSTITUTE OF ENGINEERING & TECHNOLOGY, JODHPUR
I Mid-Term Examination, 2022-23
I B. Tech. (II Semester)
Branch: AI-ML/DS/Cys
2FY3-04: Python Programming for Problem Solving
𝟏
Time: 𝟏 𝐇𝐫𝐬. Max. Marks: 40
𝟐

Max. CO Bloom's
Marks Mapping Taxonomy
Level
PART – A
(Basics/Fundamentals related questions)
All questions are compulsory.
Q.1 (a) Enlist the applications of interactive and script modes of python [1] [CO1] [2]
programming.
Q.1 (b) Identify which of the following declarations are incorrect and give suitable [2] [CO1] [2]
reason for it?
a) __Aa = 3
b) 1abc__ = 5.0
c) X_x = ‘Hello’
d) aa_@ =1+2j
Q.1 (c) Detect the errors in the following python code: [2] [CO2] [2]
N =input (“Enter a number”)
S = N + N/N2
print (s)
Q.1 (d) Predict the output of the following python code: [2] [CO3] [2]
lst = [10, 20, 30, 40, 50]
a=0
for ele in s:
a+=ele
print(a/len(s))

PART – B
(Analytical/Numerical questions)
Attempt one question either A or B from each question.
Q.2 (A) Differentiate between Identifiers and Keywords of Python w.r.t. any four [4] [CO1] [2]
attributes.
OR
Q.2 (B) Write a python code to compute the mean of the values taken input using [4] [CO1] [3]
command line arguments.
Q.3 (A) Write a python code to display the following pattern using for-else loop. [4] [CO2] [3]
*
* *
* * *
* * * *
* * * * *
Page 1 of 3
OR
Q.3 (B) For finding the maximum out of the given three numbers, following code has [2+2] [CO2] [2]
been written. Detect the errors in it and rewrite the code to display the final
output.
x, y, z = 20, 30, 40;
if x > y and x > z
print (‘biggest=’, + str(x));
elif y > x and y > z:
print ((‘biggest=’, + str(y));
else z > x and z > y:
print ((‘biggest=’, + str(z));

Q. 4 (A) What will be the output of the following instructions? [4*1] [CO3] [2]
Given, string1 = 'I am Student of JIET, Jodhpur'
a) print ('string =', string1)
b) print (string1. lower ())
c) print (string1. index ('a'))
d) print (string1 + ' (Rajasthan)')
OR
Q. 4 (B) Write a user interfacing program to remove all the duplicates from a list of [4] [CO3] [3]
20 numbers. Display the final list as output of the program.

PART – C
(Descriptive/Analytical/Problem Solving/Design questions)
Attempt any 2 out of 3 (Q.4 to Q.6)
Q.5 Discuss the key features of Python Programming Language which makes it [8+2] [CO1] [1]
significant for various fields. Also, mention any four application areas where
it is being popularly used.

Q.6 Predict the output of following instructions, when they will be executed in [2*5] [CO2] [2]
python compiler. If there would be any error, then output will be that error
detection.
(a) for i in range (1,10):
print (‘i1 =’, i)
if (i= = 5):
break
print (‘i2 =’, i)
print (‘i3 =’, i)

(b) for j in range (1,10):


print (‘j1 =’, j)
if (j= = 5):
continue
print (‘j2 =’, j)
print (‘j3 =’, j)

(c) print (7 % 7 + 7//7 – 7*7)

(d) a= ‘Python’; b= ‘Programming’; c= ‘for Students’


print (‘Final output will be {0} + {1} + {2}’. format (a, b, c))
Page 2 of 3
(e) a=1
while (a<10):
a*=5
print ('a1=', a)
if (a == 6):
print ('a2=', a)
pass
print ('Execution of pass')
a+=1
print ('a3=', a)
Q.7 Write a user interactive python program to accept the positive integer [4+6] [CO3] [3]
numbers as inputs, from the user and create a list of it. Sanitize the list by
removing all the prime numbers from it. Also, display the output.
*******

Page 3 of 3

You might also like