Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

Python Programming Aug 2022

This document contains 10 questions from 5 units on Python programming for a technical exam. The questions cover key topics like Python features, operators, conditional and loop statements, strings, lists, functions, modules, file handling, exceptions, GUI programming and Scratch. Students must answer 5 questions by selecting 1 question from each unit, with all questions carrying equal marks.

Uploaded by

Bad Bᝪγ Gamer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Python Programming Aug 2022

This document contains 10 questions from 5 units on Python programming for a technical exam. The questions cover key topics like Python features, operators, conditional and loop statements, strings, lists, functions, modules, file handling, exceptions, GUI programming and Scratch. Students must answer 5 questions by selecting 1 question from each unit, with all questions carrying equal marks.

Uploaded by

Bad Bᝪγ Gamer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Code No: R201225 R20 SET - 1

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) List out and explain the key features of Python programming. (7M)
b) What is a Conditional statement in Python programming? Give the syntax of (7M)
various Conditional structures available in Python programming.
Or
2 a) How to access the characters in Python String? Write a Python program to (7M)
demonstrate it.
b) Write a Python program to demonstrate the usage of Logical, Membership and (7M)
Identity operators.
Unit - II
3 a) Write the syntax of various Loop statements supported by Python programming and (10M)
explain their execution behavior with neat flow diagrams.
b) How to Encrypt and Decrypt Strings in Python? Explain with an example. (4M)
Or
4 a) Write a Python program to demonstrate the usage of common Python String (7M)
methods.
b) Develop a Python program to display the Fibonacci series between 0 and 100. (7M)
Hint : The Fibonacci Sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, 13, …
Unit - III
5 a) List out various Python List Built-in methods and write a program to demonstrate (7M)
their usage.
b) Write a Python function to print the even numbers from a given list. (7M)
Or
6 a) Develop a Python program to access the elements of a Nested dictionary. (7M)
b) What are Python modules? Explain the steps to import specific attributes from a (7M)
module into the current Namespace with appropriate code snippets.
Unit - IV
7 a) Explain the prototypes of read(), readline() and readlines() functions in Python. (7M)
b) Write about Class Inheritance and demonstrate the usage of issubclass() and (7M)
isinstance() methods in Python.
Or
8 a) How do you manipulate a file pointer in Python? Explain with a sample program. (7M)
b) Does Python Support Operator overloading? Justify. (7M)
Unit - V
9 How to create, raise and handle user defined exceptions in Python? Illustrate with a (14M)
Python program.
Or
10 a) Give the syntax to create Radiobutton widget. And write a Python program to create (7M)
Radiobuttons for selecting the Gender(Male, Female, Transgender) on the same
canvas.
b) What type of programming is Scratch? What are the different kinds of Scratch (7M)
blocks?
1 of 1
|''|''|||''|'''|||'|
Code No: R201225 R20 SET - 2
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) List out various operators available in Python and explain their precedence and (7M)
associativity
b) Write a python program to calculate the total amount to be paid by user after (7M)
reducing the 10% discount on purchases more than 1000 rupees.
Or
2 a) Discuss various Python Built-in functions for manipulating Strings. (7M)
b) Explain the syntax of different Nested Decision structures in Python (7M)
programming.
Unit - II
3 a) Explain the execution behavior of ‘for’ loop statement supported by Python (7M)
programming with an example program.
b) Elaborate the sequence of steps to encrypt and decrypt Strings in Python. (7M)
Or
4 a) Write a Python program that prints all the numbers from 0 to 100 except the (7M)
multiples of 4 and 6.
b) Compare and Contrast Pre-test and Post-test loop structures in Python (7M)
programming.
Unit - III
5 a) Discuss various ways to access the elements of a List in Python with appropriate (7M)
code snippets.
b) What is a Lambda function in Python? What are the benefits of Lambda function (7M)
in Python? Demonstrate its usage through a sample program.
Or
6 a) Explain the steps to create a Dictionary in Python and list out Dictionary Built-in (7M)
functions.
b) Write about the following features in Python programming (7M)
i)Modules ii) globals() and locals() Functions iii)Packages

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.

b) Elaborate on various Conditional structures in Python programming and explain (7M)


the syntax of each.
Unit - II
3 a) Write a Python program to construct the following pattern, using a nested for loop. (7M)
*
**
***
****
*****
****
***
**
*
b) What is meant by Data Encryption? What are its types? What are the libraries (7M)
available in Python for Data Encryption?
Or
4 a) Write a Python program to demonstrate the usage of Loop control statements (7M)
available in Python programming.
b) How to write a String to a text file in Python? Explain with a sample program. (7M)

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

|''|''|||''|'''|||'|

You might also like