DR.
BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE
Supplementary Winter Examination – 2023
Course: B. Tech. Branch : Electronics and Telecommunication Engineering
Semester : IV
Subject Code & Name: BTETPE405E Python Programming
Max Marks: 60 Date: 25/01/2024 Duration: 3 Hr.
Instructions to the Students:
1. All the questions are compulsory.
2. The level of question/expected answer as per OBE or the Course Outcome (CO) on
which the question is based is mentioned in ( ) in front of the question.
3. Use of non-programmable scientific calculators is allowed.
4. Assume suitable data wherever necessary and mention it clearly.
(Level/CO) Marks
Q. 1 Solve Any Two of the following. 12
A) Explain the concept of REPL in Python. How can the Python REPL be utilized CO 01 6
for quick code experimentation and testing?
B) Define the term 'variable' in Python. Explain the rule of variable assignment CO 01 6
in Python.
C) Describe the significance of indentation in Python programming. Provide an CO 01 6
example illustrating the importance of proper indentation in Python.
Q.2 Solve Any Two of the following. 12
A) Discuss the logical operators in Python and their use in conditional CO 01 / 02 6
expressions. Write a Python program that takes two integers as input from the
user and prints the maximum of the two numbers.
B) How dictionary comprehensions are different from list comprehensions, CO 01 6
provide an example for each with explanation.
C) If the employee’s basic salary is input through the keyboard. His dearness CO 02 6
allowance is 45% of basic salary, and house rent allowance is 25% of basic
salary. Write a program to calculate his gross salary.
Q. 3 Solve Any Two of the following. 12
A) Explain the concept of lambda functions in Python with example. Discuss CO 01 / 02 6
limitations and advantages of using lambda functions compared to regular
functions.
B) Explain the purpose of the import statement in Python. Differentiate between CO 01 / 02 6
the import and from...import statements. Provide examples of each.
C) If a five-digit number is input through the keyboard, write a program to CO 02 6
calculate the sum of its digits.
Q.4 Solve Any Two of the following. 12
A) Explain the concept of inheritance in Python, and how it allows for code CO 01 6
reusability. Provide an example demonstrating inheritance in Python classes.
B) Differentiate between an error and an exception in Python. Explain the CO 01 / 02 6
process of handling exceptions in Python using the try-except block with
example.
C) Write a python program to print following star pattern. CO 02 6
*****
****
***
**
*
Q. 5 Solve Any Two of the following. 12
A) Explain Turtle Graphics used in Python for graphical representation with CO 02 6
example and its application.
B) Explain the importance of testing in software development. Discuss the CO 03 6
process of writing effective test cases in Python.
C) A library charges a fine for every book returned late. For first 5 days the fine CO 02 6
is 1 rupee, for 6-10 days fine is 2 rupee and above 10 days fine is 5 rupees. If
you return the book after 30 days your membership will be cancelled. Write
a program to accept the number of days the member is late to return the book
and display the fine or the appropriate message.
*** End ***