Python Programming Aug 2022
Python Programming Aug 2022
Unit - IV
7 a) Explain the steps to read config files and write Log files in Python. (7M)
b) What are the different modes of opening a file in Python? Explain the Python (7M)
‘open()’ built-in function.
Or
8 a) Explain about write() and writelines() functions in Python. (7M)
b) Write Python code snippets to illustrate Method overriding and Method (7M)
overloading concepts.
1 of 2
|''|''|||''|'''|||'|
Code No: R201225 R20 SET - 2
Unit - V
9 a) Write a Python program to handle Division By Zero exception. (7M)
b) Explain the purpose of ‘else’ and ‘finally’ blocks in exception handling with a (7M)
Python program.
Or
10 a) Write a Python GUI program to create three single line text-box to accept a value (7M)
from the user using tkinter module
b) Explain in brief the four main elements of Scratch programming environment. (7M)
2 of 2
|''|''|||''|'''|||'|
Code No: R201225 R20 SET - 3
I B. Tech II Semester Regular/Supplementary Examinations, August- 2022
PYTHON PROGRAMMING
(Com. To CSE, IT, CSE-AI&ML,CSE-AI, CSE-DS, CSE-AI&DS, AI&DS )
Time: 3 hours Max. Marks: 70
Answer any five Questions one Question from Each Unit
All Questions Carry Equal Marks
Unit - I
1 a) Describe the features of Python that made it so popular. (7M)
b) List out and explain Comparison, Identity and Membership operators in Python (7M)
programming.
Or
2 a) Write a Python program to demonstrate the usage of all specifiers available with (7M)
format() method.
Unit - III
5 a) Explain about Negative indexing and List Slicing in Python with a sample (7M)
program.
b) Write a Python function to check whether a number is perfect or not. (7M)
Or
6 a) Explain the steps to access the elements of a Dictionary using various Built-in (7M)
functions.
b) Write a Python program to extract characters from various text files and puts them (7M)
into a List.
1 of 2
|''|''|||''|'''|||'|
Code No: R201225 R20 SET - 3
Unit - IV
7 a) Write about read () and write () methods in Python programming. (7M)
b) Explain the prototype of seek () function in Python and write a program to (7M)
demonstrate its usage.
Or
8 a) Describe the steps to create Classes and Objects in Python. List out the Built-in (7M)
Class attributes.
b) When do we need a separate configuration file? Explain the steps for writing, (7M)
reading and extracting values from config files in Python.
Unit - V
9 a) Briefly discuss various keywords related to Exception handling in Python (7M)
programming.
b) Write a python program to illustrate the cases where a try block throws multiple (7M)
exceptions.
Or
10 a) Write a Python GUI program to create Listbox bar widgets using tkinter module. (7M)
b) How to create Option Menu using tkinter in Python? Illustrate with a program. (7M)
2 of 2
|''|''|||''|'''|||'|
Code No: R201225 R20 SET - 4
I B. Tech II Semester Regular/Supplementary Examinations, August- 2022
PYTHON PROGRAMMING
(Com. To CSE, IT, CSE-AI&ML,CSE-AI, CSE-DS, CSE-AI&DS, AI&DS )
Time: 3 hours Max. Marks: 70
Answer any five Questions one Question from Each Unit
All Questions Carry Equal Marks
Unit - I
1 a) Draw a table to describe the precedence and associativity of Python operators. (5M)
b) Write a Python program to find those numbers which are divisible by 5 and (9M)
multiples of 3, between 1 and 1000.
Or
2 a) Explain the Python built-in functions to perform data type conversions. (7M)
b) Explain the execution behavior of various Decision making statements available in (7M)
Python programming with neat flow diagrams.
Unit - II
3 a) Give the syntax of various Loop statements supported by Python programming. (7M)
b) Write a Python program to get substring between characters in the input. (7M)
Or
4 a) Write a Python program to compute the natural logarithm of 2, by adding up to n (7M)
terms in the series 1 – ½+ 1/3 – ¼ + 1/5 -… 1/n
where n is a positive integer and input by user.
b) Develop a Python program to search the string ‘laptop’ in “sales.txt” file and print (7M)
its line along with the line number.
Unit - III
5 a) Discuss various ways to create Lists in Python and Write a program to illustrate (7M)
Negative index List slicing.
b) What is an Anonymous function and when should you use it? How Anonymous (7M)
function is different from normal function?
Or
6 a) Write the properties of Dictionary Keys in Python. And explain how to access, (7M)
delete and update Dictionary elements.
b) Explain the steps to install, search, upgrade and uninstall a package in Python with (7M)
‘pip’.
Unit - IV
7 a) Explain the steps for reading and writing config files in Python. (7M)
b) Describe the Python Built-in function for opening, reading, writing and closing (7M)
files.
Or
8 a) Write a Python program to create a class ‘student’ with members {name, branch, (7M)
grade}. Define appropriate member functions for reading and displaying the
student information.
b) How can polymorphism be implemented in Python? Illustrate with a code snippet. (7M)
1 of 2
|''|''|||''|'''|||'|
Code No: R201225 R20 SET - 4
Unit - V
9 a) List and explain any 12 Built-in Exceptions available in Python. (7M)
b) Explain the usage of ‘except’ clause in Python with multiple exceptions and no (7M)
exceptions.
Or
10 Explain the syntax and parameters of the following Widgets using tkinter in (14M)
Python with appropriate code snippets.
i)Scrollable List Box
ii)Menu
iii)Progress bar
2 of 2
|''|''|||''|'''|||'|