0% found this document useful (0 votes)
64 views

PYTHON PROGRAMMING March 2021

This document contains a sample exam paper for a Python programming course. It includes 10 questions with sub-questions that cover various Python topics like data types, operators, control flow statements, strings, lists, dictionaries, files, classes, inheritance and exceptions. Students have to attempt any 5 questions out of the 10, with each question carrying equal marks. The questions test concepts like data type conversion, string formatting, loops, functions, OOP concepts, file handling etc. through problems and explanations.

Uploaded by

SRINIVAS KVV
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

PYTHON PROGRAMMING March 2021

This document contains a sample exam paper for a Python programming course. It includes 10 questions with sub-questions that cover various Python topics like data types, operators, control flow statements, strings, lists, dictionaries, files, classes, inheritance and exceptions. Students have to attempt any 5 questions out of the 10, with each question carrying equal marks. The questions test concepts like data type conversion, string formatting, loops, functions, OOP concepts, file handling etc. through problems and explanations.

Uploaded by

SRINIVAS KVV
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Code No: R1921053 R19 SET - 1

II B. Tech I Semester Regular Examinations, March - 2021


PYTHON PROGRAMMING
(Com to CSE,IT)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions each Question from each unit
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~~~~

1 a) Write a Python program to convert temperature in degree Celsius to degree [8M]


Fahrenheit. If water boils at 100 degree C and freezes as 0 degree C, use the
program to find out what is the boiling point and freezing point of water on the
Fahrenheit scale. (Hint: T(°F) = T(°C) × 9/5 + 32)
b) Explain about input validation loops and nested loops with examples. [7M]

Or
2 a) Write a program to generate Fibonacci series using Python. [8M]
b) Write a program to repeat the string ‘‘GOOD MORNING” n times. Here ‘n’ is an [7M]
integer entered by the user.
3 a) What are Python string padding functions? Explain with examples. [8M]
b) Explain about string formatting operators methods with examples. [7M]

Or
4 a) How to encrypt and decrypt strings in Python? Explain. [8M]
b) Write a program that reads a string from the user and uses a loop to determines [7M]
whether or not it is a palindrome. Display the result, including a meaningful output
message.
5 a) What are Python list/Array methods? Explain. [8M]
b) How to import modules in Python? Explain with examples. [7M]

Or
6 a) What are Python directory methods? Explain. [8M]
b) Describe Python default and keyword arguments with examples. [7M]
7 a) What are advantages and disadvantages of OOP? Explain. [8M]
b) What are built-in class attributes? Explain. [7M]

Or
8 a) Explain about structuring classes with inheritance and polymorphism. [8M]
b) Describe readline( ) and readlines( ) methods with examples. [7M]
9 Explain the following:
a) Handling exceptions [8M]
b) Multi-line text widgets [7M]

Or
1 of 2

||''|''||''||''''''|
Code No: R1921053 R19 SET - 1

10 Explain the following:


a) Defining clean-up actions [8M]
b) Entry fields for the input and output of text [7M]

2 of 2

||''|''||''||''''''|
Code No: R1921053 R19 SET - 2

II B. Tech I Semester Regular Examinations, March - 2021


PYTHON PROGRAMMING
(Com to CSE, IT)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions each Question from each unit
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~~~~

1 a) What is about Python programming language? Explain program development [8M]


cycle.
b) The formula E = mc2 states that the equivalent energy (E) can be calculated as the [7M]
mass (m) multiplied by the speed of light (c = about 3×108 m/s) squared. Write a
program that accepts the mass of an object and determines its energy.
Or
2 a) Describe if, if-else, if-elif-else Statements with examples. [8M]
b) Write a program that asks the user to enter their name and age. Print a message [7M]
addressed to the user that tells the user the year in which they will turn 100 years
old.
3 a) What are Python string substitution functions? Explain with examples. [8M]
b) Explain in detail about while loop with suitable example. [7M]

Or
4 a) Write a Python program to check a prime a prime number. [8M]
b) Write a Python program to convert decimal integer into binary. [7M]
5 a) Discuss about variable length and keyword arguments with examples. [8M]
b) What are docstrings for Python modules? Explain. [7M]

Or
6 a) Write a Python program to create three dictionaries, then create one dictionary that [8M]
will contain the other three dictionaries.
b) Discuss about dictionary clear( ), copy( ), get( ) and items( ) methods. [7M]
7 a) Explain about creating classes and instance objects with examples. [8M]
b) Discuss about real time use of class in live projects. [7M]

Or
8 a) Describe manipulating file pointer using seek with suitable example. [8M]
b) What are base overloading methods? Explain. [7M]
9 Explain the following:
a) Syntax errors [8M]
b) Scrolling list boxes [7M]

Or

1 of 2
||''|''||''||''''''|
Code No: R1921053 R19 SET - 2

10 Explain the following:


a) Predefined clean-up actions [8M]
b) Event-driven programming [7M]

2 of 2

||''|''||''||''''''|
Code No: R1921053 R19 SET - 3

II B. Tech I Semester Regular Examinations, March - 2021


PYTHON PROGRAMMING
(Com to CSE, IT)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions each Question from each unit
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~~~~

1 a) Write a program to calculate in how many days a work will be completed by [8M]
three persons A, B and C together. A, B, C take x days, y days and z days
respectively to do the job alone. The formula to calculate the number of days if
they work together is xyz/(xy + yz + xz) days where x, y, and z are given as
input to the program.
b) Discuss about mutable and immutable Data types in Python with examples. [7M]

Or
2 a) Explain about precedence of all operators in Python. [8M]
b) Write the corresponding Python assignment statements: [7M]
i) Assign 10 to variable length and 20 to variable breadth.
ii) Assign the average of values of variables length and breadth to a variable
sum.
iii) Assign a list containing strings ‘Paper’, ‘Gel Pen’, and ‘Eraser’ to a variable
stationery.
iv) Assign the strings ‘Mohandas’, ‘Karamchand’, and ‘Gandhi’ to variables
first, middle and last.
v) Assign the concatenated value of string variables first, middle and last to
variable fullname. Make sure to incorporate blank spaces appropriately between
different parts of names.
3 a) Discuss about string search functions with examples. [8M]
b) What are built-in string conversion functions? Explain. [7M]

Or
4 a) Explain about text files and their format with examples. [8M]
b) What are string operators in Python? Explain with examples. [7M]
5 a) Discuss about list pop( ), insert( ) and remove( ) methods with examples. [8M]
b) Explain the concept nested dictionary with suitable example. [7M]

Or
6 a) Explain about Python dictionary update( ), value( ), get( ) and keys ( ) methods. [8M]
b) What are Python built-in functions? Explain. [7M]
7 a) Explain in detail about read functions in Python with examples. [8M]
b) Discuss about class inheritance in Python with example. [7M]

Or
1 of 2

||''|''||''||''''''|
Code No: R1921053 R19 SET - 3

8 a) Describe adding and retrieving dynamic attributes of classes in detail. [8M]


b) Explain about reading numbers from a file using Python program. [7M]
9 Explain the following:
a) Exceptions [8M]
b) Grid attributes [7M]

Or
10 Explain the following:
a) User-defined exceptions [8M]
b) Using nested frames to organize components [7M]

2 of 2

||''|''||''||''''''|
Code No: R1921053 R19 SET - 4

II B. Tech I Semester Regular Examinations, March - 2021


PYTHON PROGRAMMING
(Com to CSE, IT)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions each Question from each unit
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~~~~

1 a) Write a Python program to calculate the amount payable if money has been lent [8M]
on simple interest.
Principal or money lent = P, Rate of interest = R% per annum and Time = T
years. Then Simple Interest (SI) = (P x R x T)/ 100.
Amount payable = Principal + SI.
P, R and T are given as input to the program.
b) Explain about explicit conversion with examples. [7M]

Or
2 a) Presume that a ladder is put upright against a wall. Let variables length and [8M]
angle store the length of the ladder and the angle that it forms with the ground as
it leans against the wall. Write a Python program to compute
the height reached by the ladder on the wall for the following values of length
and angle:
i) 16 feet and 75 degrees
ii) 20 feet and 0 degrees
iii) 24 feet and 45 degrees
iv) 24 feet and 80 degrees
b) What are assignment operators in Python? Explain with examples. [7M]
3 a) Write a Python program to check a palindrome sequence. [8M]
b) Explain about data encryption in Python. [7M]

Or
4 a) Discuss about while loop in Python with suitable examples. [8M]
b) Write a Python program to convert Decimal integer into binary. [7M]
5 a) Explain about anonymous or Lambda function with merits and demerits. [8M]
b) Discuss about importing module from a package. [7M]

Or
6 a) What is recursion? Explain recursion concept with suitable Python program. [8M]
b) Explain about Python functions with examples. [7M]
7 a) Discuss about concepts of class, object and instances in Python. [8M]
b) Explain the concept of inheritance in Python with examples. [7M]

Or
8 a) Give an overview of OOP terminology. [8M]
b) Describe case study of an ATM using classes. [7M]
1 of 2
||''|''||''||''''''|
Code No: R1921053 R19 SET - 4

9 Explain the following:


a) Raising exceptions [8M]
b) Terminal based version [7M]

Or
10 Explain the following:
a) User-defined exceptions [8M]
b) Command buttons and responding to events [7M]

2 of 2

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

You might also like