DR.
BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE
Bachelor of Technology (Electronics and Computer Engineering) SEMESTER - 4 Summer 2025 ( Regular )
Course :Bachelor of Technology (Electronics and Computer Engineering) Branch : Engineering and Technology
Semester : SEMESTER - 4
Subject Code & Name: BTECPC401 - PYTHON PROGRAMMING
025338141
025338141
025338141
Time : 3 Hours] [Total Marks : 60
Instructions to the Students:
[Link] question carries 12 marks.
[Link] No. 1 will be compulsory and include objective-type questions.
[Link] are required to attempt any four questions from Question No. 2 to Question
No.6
[Link] of non-programmable scientific calculators is allowed.
[Link] suitable data wherever necessary and mention it clearly.
Q1. Objective type questions. (Compulsory Question) 12
1 In which year was Python first released?
a) 1989 b) 1991 c) 1994 d) 2000
025338141
025338141
025338141
2 Which of the following is a Python keyword?
a) define b) class c) variable d) print
3 What command checks Python version?
a) --version b) -v c) --check d) version()
4 Which sequence type is immutable?
a) List b) Tuple c) Set d) Dictionary
5 Which operator checks if an element is in a sequence?
a) is b) in c) and d) or
6 What keyword is used for multiple conditions in Python?
a) if b) elif c) else d) switch
025338141
025338141
025338141
7 What does a lambda function lack?
a) Arguments b) Name c) Return d) Scope
8 What is the scope of a variable defined inside a function?
a) Global b) Local c) Module d) Package
9 What is a namespace in Python?
a) Module b) Scope c) Package d) Function
10 What is encapsulation?
a) Inheriting b) Hiding c) Overriding d) Overloading
11 What is used to execute SQL queries in Python?
a) Cursor b) Connection c) Commit d) Fetch
12 Which module is used for data compression in Python?
a) zipfile b) os c) sys d) math
1
Q2. Solve the following.
A) Describe the role and significance of Python’s building blocks: keywords, 6
identifiers, variables, and indentation. Provide examples for each.
B) Write a Python program to concatenate two strings provided by the user and 6
display the result in uppercase.
Q3. Solve the following.
A) Write a Python program to find the largest among three numbers entered by the 6
025338141
025338141
025338141
user using nested if-else statements.
B) Discuss the various types of operators in. Explain operator precedence and 6
associativity with examples.
Q4. Solve Any Two of the following.
A) Describe default and positional arguments in Python. Provide a code example of a 6
function using both argument types.
B) Explain the role of PIP in Python package management. Provide the commands to 6
install, uninstall, and list packages using PIP with explanations.
C) Write a Python program to define a recursive function that calculates the factorial 6
of a number and handles negative input using a base case.
Q5. Solve Any Two of the following.
025338141
025338141
025338141
A) Describe encapsulation and data hiding in Python. Provide a code example to 6
show how private attributes are implemented and accessed.
B) Write a Python program to create a class representing a rectangle with methods to 6
calculate area and perimeter.
C) Explain the difference between errors and exceptions in Python. Provide examples 6
of a syntax error and a runtime exception with explanations.
Q6. Solve Any Two of the following.
A) Write a Python program to write user-entered student details (name, roll number) 6
to a CSV file and display its contents.
B) Write a Python program to draw a square spiral pattern using turtle graphics based 6
on a user-entered number of iterations.
025338141
025338141
025338141
C) Discuss the datetime module in Python for handling date and time. Provide 6
examples of formatting dates and calculating time differences.
* * * End * * *