GNITS-R- 22 – 123AV
G. Narayanamma Institute of Technology & Science
(Autonomous) (for Women)
Shaikpet, Hyderabad- 500 104
[Link] I-Semester Regular Examinations, Jan/Feb - 2024
PYTHON PROGRAMMING
(Common to EEE, ECE, ETE, CSE, IT, CST, CSM & CSD)
Max. Marks: 60 Time: 03 Hours
Note:
1. Question paper comprises of Part A and Part B.
2. Part A is compulsory which carries 10 marks. Answer all questions in Part A.
3. Part B (for 50 marks) consists of five questions with “either” “or” pattern. Each question
carries 10 marks and may have a,b,c as sub questions. The student has to answer any one
full question.
PART-A
(Answer 10 questions. Each question carries 1 mark)
[Link]. Question Marks CO BL
Q.1 a) Difference between input function and raw_input function. [01] CO1 [L4]
b) What is a compound Boolean expression? [01] CO1 [L1]
c) Make use of flow chart to explain while loop logic. [01] CO2 [L3]
d) Difference between void function and value returning function. [01] CO2 [L2]
e) Explain the way to convert String to a list in Python. [01] CO3 [L2]
f) Define Serializing objects. [01] CO3 [L1]
g) List any two differences between Module and Package. [01] CO4 [L1]
h) What is a Regular expression? [01] CO5 [L1]
i) Describe the way to display Entry widget in Python. [01] CO5 [L2]
j) Differentiate between bar plot and box plot. [01] CO6 [L3]
END OF PART A
PART-B
(Answer 05 full questions. Each question carries 10 marks)
[Link]. Question Marks CO BL
Q.2(a) Explain the syntax of print() built-in function with code examples. [05] CO1 [L2]
(b) Write a Python program to covert temperature value from Centigrade to
[05] CO1 [L3]
Fahrenheit.
OR
Q.3(a) Explain Logical Operators with examples. [05] CO1 [L2]
(b) Explain decision structure of if-elif-else with a program. [05] CO2 [L2]
Page 1 of 2
GNITS-R- 22 – 123AV
Q.4(a) Compare and contrast for loop and while loop. [05] CO2 [L4]
(b) Write a Python program to print sum of first ‘n’ prime numbers. [05] CO2 [L3]
OR
Q.5(a) How to declare and call functions in a Python program? Illustrate with an
example. [05] CO2 [L1]
(b) Write a Python program to calculate factorial of a number using recursion. [05] CO2 [L3]
----------------------------------------------------------------------------------------------------------------------------------------
Q.6(a) Explain about tuple and its methods with suitable examples.
----------------------------------------------------------------------------------------------------------------------------------
[05] CO3 [L2]
(b) For a=[‘hello’, ‘how’, [1,2,3], [[10,20,30]]] what is the output of following
statement.
i) print( a[ : : ] ) ii) print(a[-3][0]) [05] CO3 [L3]
iii) print(a[2][ : -1]) iv) print(a[0][ : : -1])
OR
Q.7(a) Explain Python string handling methods with examples: split(), endswith(),
strip(), rstrip(), lstrip(). [05] CO3 [L2]
(b) Write a Python program to demonstrate mathematical operations on sets. [05] CO3 [L3]
-------------------------------------------------------------------------------------------------------------------------------------
Q.8(a) Explain the else block and finally block in exception handling through an
example program. [05] CO4 [L2]
(b) Explain about Module built-in functions in Python. [05] CO4 [L2]
OR
Q.9(a) Write python program to append the content of second file to first file.
[ read two file names as Command Line arguments] [05] CO4 [L3]
(b) List out what are the different character classes and its representation and
regular expression symbols and their meaning. [05] CO5 [L1]
-------------------------------------------------------------------------------------------------------------------------------------
Q.10(a) Illustrate the usage of Label to display text in a window with a program. [05] CO5 [L2]
(b) Demonstrate Radio button widgets with a program. [05] CO5 [L2]
OR
Q.11(a) Compare line and scatter plots and their usage. [05] CO6 [L2]
(b) Write a Python code snippet to plot a scatter plot with different colors and sizes
[05] CO6 [L3]
for different points.
END OF PART B
END OF THE QUESTION PAPER
Page 1 of 2