Msword&rendition 1

You might also like

Download as pdf or txt
Download as pdf or txt
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 DESIGN & TECHNOLOGY, JODHPUR
I Mid-Term Examination, 2022-23
I B. Tech. (II Semester)
Branch: AIML
2FY3-04: Python Programming for Problem Solving
Time: 112Hrs. Max. Marks: 40

Max. CO Bloom's
Marks Mapping Taxonomy
Level

PART – A
(Basics/Fundamentals related questions)
All questions are compulsory.

Q.1 (a) What is meant by dynamic type language? [2] [CO1] [1]

Q.1 (b) What is the difference between == and “ is” operator? [2] [CO2] [1]

Q.1 (c) What will be output of following statement. [2] [CO2] [1]
print(2 ** 6 // 8 % 2)
Q.1 (d) What will be the output of following python code? [2] [CO3] [1]
x=all((15 > 5, 10 > 20, 15>=15))
print(x)
PART – B
(Analytical/Numerical questions)
Attempt one question either A or B from each question.

Q.2 (A) What are the rules for naming identifier in python language. [4] [CO1] [2]

OR

Q.2 (B) Write a program for executing command line arguments. [2+2] [CO1] [2]
Program must take input any 3 details like name, date of birth,
roll no. etc.

Q.3 (A) Find out errors if any in the following programs. [2+2] [CO2] [2]
i. x, y = 30, 40
if x == y :
print('x is equal to y')
elseif x > y :
print('x is greater than y')
else x < y :
Page 1 of 3
print('x is less than y')

ii. j= 1
while j <= 10 :
print(j)
j++
OR

Q.3 (B) What will be the output of following programs. [4] [CO2] [2]
i. for i in range(20,30,2):
i+=5
print(i)

ii. for i in range(20,40,3):


if i==29:
continue
elif i==32:
pass
elif i>35:
break
print(i)
Q.4 (A) What will be the output of following programs. [2+2] [CO3] [2]
1. X=[“ Gryffindor” , “ Slytherin” , “ Hufflepuff” ,
“ Ravenclaw” ]
i=0
while x[i]!=None:
print(x[i])
i+=1
2. bird=["Crane","Goose","Wood-Pecker", "Vulture", "Ostrich",
"Flamingo"]
print(bird[ : :-2])
OR

Q.4 (B) Explain following string methods with a suitable example. [4] [CO3] [2]
i. title()
ii. swapcase()
iii. partition()
iv. index()
PART – C
(Descriptive/Analytical/Problem Solving/Design questions)
Attempt any 2 out of 3 (Q.4 to Q.6)

Page 2 of 3
Q.5 Explain applications and features of python programming [10] [CO1] [2]
language.
Q.6 a) Write a user interfacing program to check whether a given [5+5] [CO2] [3]
number is prime number or not.
b) Write a python program to find roots of quadratic equation.

Q.7 Perform the following operations on a list of names and print the [10] [CO3] [3]
list after each operation.
- Create a list of 5 names - ‘ Manohar’ , ‘ Krishna’ , ‘ Murli’ ,
‘ Shyam’ , ‘ Govind’ .
-Add the name ‘ Gopal’ in between Krishna and Murli.
-Add the name ‘ Kanha’ at the end of the list.
- Sort all the names in the list like in an English dictionary.
- Print reversed list

*******

Page 3 of 3

You might also like