PYTHON PROGRAMMING March 2021
PYTHON PROGRAMMING March 2021
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
2 of 2
||''|''||''||''''''|
Code No: R1921053 R19 SET - 2
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
2 of 2
||''|''||''||''''''|
Code No: R1921053 R19 SET - 3
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
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
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
Or
10 Explain the following:
a) User-defined exceptions [8M]
b) Command buttons and responding to events [7M]
2 of 2
||''|''||''||''''''|