Python Programming KNC402 2021
Python Programming KNC402 2021
BTECH
(SEM IV) THEORY EXAMINATION 2021-22
PYTHON PROGRAMMING
SECTION A
1. Attempt all questions in brief. 2.5*4 = 10
Qno Questions CO
(a) Discuss why Python is called as dynamic and strongly typed language? 1
(b) How pass statement is different from a comment? 2
(c) Write a for loop that prints numbers from 0 to 57, using range function. 2
(d) What is the difference between Python Arrays and Lists? 3
SECTION B
2. Attempt any two of the following: 4*2 = 8
Qno Questions CO
(a) Write a python function named ComputeAverage to find average of a list of 3
numbers. It should handle the exception if the list is empty and return 0 in
that case.
(b) Implement the binary search technique. 5
(c) Explain the use of break and continue with a suitable example. 2
90
2
13
SECTION C
_2
2.
Qno Questions CO
P2
24
(a) What do you mean by operator precedence and associativity. Explain. 1
2E
5.
(b) Write short notes on 1
.5
P2
Qno Questions CO
2
2:
(b) Write a program that accepts a sentence and calculate the number of digits, 2
13
Qno Questions CO
-2
(a) There is a file named Input.Txt. Enter some positive numbers into the file 4
08
named Input.Txt. Read the contents of the file and if it is an odd number
write it to ODD.TXT and if the number is even, write it to EVEN.TXT
2-
QP22EP2_290 | 02-08-2022
Downloaded 13:32:26 | 117.55.242.132
from : uptukhabar.net