0% found this document useful (0 votes)
10 views8 pages

ModuleWiseDomainQuestions Final

The document outlines a comprehensive curriculum for Python programming across various domains, including Automotive and Banking. It covers fundamental concepts such as flow control, functions, lists, dictionaries, file handling, and object-oriented programming. Each module contains practical exercises and questions designed to enhance understanding and application of Python in real-world scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

ModuleWiseDomainQuestions Final

The document outlines a comprehensive curriculum for Python programming across various domains, including Automotive and Banking. It covers fundamental concepts such as flow control, functions, lists, dictionaries, file handling, and object-oriented programming. Each module contains practical exercises and questions designed to enhance understanding and application of Python in real-world scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module1: Automotive Domain - Python Basics & Flow Control

1. Write a Python expression to calculate the fuel efficiency of a car given the distance traveled
(in km) and fuel consumed (in liters).
2. What data type would you use to store the mileage of a car (e.g., 18.5 km/l)? Justify your
answer.
3. Write a Python program to concatenate two strings representing a vehicle’s make and model
(e.g., "Toyota" and "Corolla").
4. Write a Python program that asks for the user’s car speed and checks whether it exceeds a
given speed limit using conditional statements.
5. How can you use [Link]() in a program that monitors engine temperature and exits if
it crosses a critical threshold?
6. Given a vehicle’s fuel level (in percentage), write a program using comparison operators to
check if it’s below 15% and print a low fuel warning.
7. Write a Python script to determine if a car's engine type is "Electric", "Diesel", or "Petrol"
using Boolean and comparison operators.
8. What will be the output of the following expression in Python? print("Car" +
"Speed" * 3)
9. Write a Python program that asks for a car's current speed and displays different messages
based on speed (e.g., "Slow", "Normal", "Over-speeding").
10. What will be the output of the following expression? print(bool(0)) and
print(bool(50)) in the context of fuel level.
11. Write a Python program that imports the random module and generates a random
speed between 40 km/h and 120 km/h.
12. Explain the role of Boolean operators (and, or, not) in writing a Python program
to check if a car’s speed is in a safe range (e.g., 40-80 km/h).
13. Write a Python program to check if a vehicle is eligible for an emissions test based
on its registration year.
14. How can you use string replication to print a pattern that simulates a car moving
forward (---> ---> --->)?
15. Write a Python script to determine if a vehicle qualifies for a toll exemption based on
its type (e.g., Electric vehicles are exempt).

Module1: Banking Domain - Python Basics & Flow Control


1. Write a Python expression to calculate the interest earned on a savings account given the
principal amount, rate of interest, and time period.
2. What data type would you use to store an account balance and why?
3. Write a Python program to concatenate a bank name and a branch location (e.g., "HDFC" +
" Indiranagar").
4. Write a Python script that asks for a customer's age and checks if they qualify for a senior
citizen savings scheme using conditional statements.
5. How can [Link]() be used in an ATM transaction program when a wrong PIN is
entered multiple times?
6. Given a bank account balance, write a program that checks if there are sufficient funds for a
withdrawal of ₹5000.
7. Write a Python program that determines if a bank transaction is "Debit" or "Credit" using
Boolean and comparison operators.
8. What will be the output of the following expression in Python? print("Bank" +
"Statement" * 2)
9. Write a Python script that asks for a loan amount and interest rate and displays different
messages based on the interest rate (e.g., "Low", "Moderate", "High").
10. What will be the output of the following expression? print(bool(0.00)) and
print(bool(500.75)) in the context of account balance.
11. Write a Python program that imports the random module and generates a random
account number.
12. Explain the role of Boolean operators (and, or, not) in checking multiple loan
eligibility criteria (e.g., minimum salary, credit score).
13. Write a Python program to check if a customer is eligible for a credit card based on
their monthly income.
14. How can you use string replication to print a pattern that simulates a transaction
receipt (==== Bank Transaction ==== repeated)?
15. Write a Python script to determine if a user is eligible for an overdraft facility based
on their account type (e.g., "Savings", "Current").

Module2: Automotive Domain - Functions & Lists


1. Write a function calculate_mileage(distance, fuel) that returns the mileage
of a vehicle.
2. What will be the output of the following function?
def car_type():
return "SUV"
print(car_type())

3. Write a function that accepts a car model as a parameter and prints whether it is electric,
petrol, or diesel (based on predefined data).
4. Create a function calculate_speed(distance, time) that calculates and returns
speed. Handle division by zero using exception handling.
5. What is the significance of the None value in Python functions? Provide an example related
to car diagnostics.
6. Write a Python function that takes the number of passengers and the available seat capacity
and returns whether the vehicle is full.
7. What will be the output of the following code?
car = "Tesla"
def print_car():
print(car)
print_car()
8. Demonstrate the use of the global statement in a function that keeps track of the total
distance traveled by a vehicle.
9. Write a function get_car_info(make, model, year) that returns a formatted
string of the car’s details using keyword arguments.
10. Write a program using a list to store different fuel types available at a petrol station and
print them using a loop.
11. How can lists be used to store vehicle registration numbers? Write a Python snippet that
adds, removes, and displays the registration numbers.
12. Given a list of car speeds, write a function that returns the maximum speed recorded.
13. Modify the Magic 8 Ball program to predict random fuel efficiency values for different
driving conditions.
14. Write a Python program to sort a list of vehicle names in alphabetical order.
15. Explain the difference between lists and tuples using an example related to automotive
spare parts inventory.

Module2: Banking Domain - Functions & Lists


1. Write a function calculate_interest(principal, rate, time) that returns
the interest earned.
2. What will be the output of the following function?
def account_type():
return "Savings Account"
print(account_type())

3. Write a function that accepts an account balance and withdrawal amount as parameters and
returns whether the withdrawal is possible.
4. Create a function validate_transaction(amount, balance) that raises an
exception if the withdrawal amount exceeds the balance.
5. What is the role of the None value in Python functions? Provide an example related to a
failed banking transaction.
6. Write a Python function that takes a list of transactions (deposits and withdrawals) and
calculates the final balance.
7. What will be the output of the following code?

bank_name = "HDFC"
def print_bank():
print(bank_name)
print_bank()

8. Demonstrate the use of the global statement in a function that tracks the total number of
bank transactions.
9. Write a function get_customer_info(name, age, account_type) that returns
a formatted string of the customer’s details using keyword arguments.
10. Write a program using a list to store different loan types available in a bank and print them
using a loop.
11. How can lists be used to store multiple account numbers? Write a Python snippet that adds,
removes, and displays account numbers.
12. Given a list of account balances, write a function that returns the highest balance.
13. Modify the Magic 8 Ball program to predict random stock market outcomes.
14. Write a Python program to sort a list of customer names alphabetically.
15. Explain the difference between lists and tuples using an example related to banking
transaction records.

Module3: Automotive Domain - Dictionaries & String Manipulation


1. Create a dictionary to store car details (make, model, year, fuel type). Write a Python
function to print the details in a formatted manner.
2. How can dictionaries be used to store vehicle registration information? Write a program that
adds, updates, and retrieves registration details.
3. Write a Python function to pretty-print a dictionary storing different car brands and their
country of origin.
4. Given a dictionary of car models and their prices, write a function to return the price of a
given model.
5. How can a nested dictionary be used to store vehicle specifications (engine, transmission,
fuel efficiency)? Provide a Python example.
6. Explain the difference between lists and dictionaries in the context of storing vehicle service
history.
7. Write a Python script to iterate over a dictionary storing car models and their top speeds,
printing each model along with its speed.
8. Write a function that converts a dictionary containing car details into a formatted string
using f-strings.
9. Use string manipulation methods to validate a car registration number (e.g., check if it starts
with "KA" for Karnataka).
10. Given a string containing a vehicle identification number (VIN), write a program to
extract only the numeric portion.
11. Write a program that checks if a car's chassis number contains only alphanumeric
characters.
12. Write a Python function that counts the occurrence of each letter in a car
manufacturer’s name (e.g., "Mercedes").
13. Demonstrate the use of ord() and chr() functions to encode and decode vehicle
registration plate characters.
14. How can the pyperclip module be used in an automotive service management
system? Provide an example.
15. Implement a simple clipboard-based application that copies and pastes car details
using the pyperclip module.

Module3: Banking Domain - Dictionaries & String Manipulation


1. Create a dictionary to store customer account details (name, account number, balance,
account type). Write a Python function to print them in a structured format.
2. How can dictionaries be used to manage multiple customer transactions? Write a program to
store transactions and retrieve them based on an account number.
3. Write a Python function to pretty-print a dictionary storing different bank branches and their
IFSC codes.
4. Given a dictionary of account types and their minimum balance requirements, write a
function to return the minimum balance required for a given account type.
5. How can a nested dictionary be used to store bank customer details (personal info, account
info, transaction history)? Provide a Python example.
6. Explain the difference between lists and dictionaries in the context of managing bank
customer data.
7. Write a Python script to iterate over a dictionary storing bank names and their interest rates,
printing each bank with its rate.
8. Write a function that converts a dictionary containing banking details into a formatted string
using f-strings.
9. Use string manipulation methods to validate an account number (e.g., check if it consists of
exactly 10 digits).
10. Given a string containing a bank transaction reference number, write a program to
extract only the numeric portion.
11. Write a program that checks if a customer’s PAN number contains only uppercase
letters and digits.
12. Write a Python function that counts the occurrence of each letter in a bank's name
(e.g., "State Bank of India").
13. Demonstrate the use of ord() and chr() functions to encode and decode bank
transaction reference characters.
14. How can the pyperclip module be used in an online banking system for copying
OTPs or transaction details? Provide an example.
15. Implement a simple clipboard-based application that copies and pastes bank details
using the pyperclip module.

Module4: Automotive Domain - File Handling, Excel, CSV,


and JSON
1. Write a Python program to save a car’s fuel efficiency data into a text file and then read it
back.
2. How can you use the shelve module to store and retrieve a vehicle’s service history?
3. Write a Python script that reads a car's maintenance log stored in a text file and prints it line
by line.
4. Explain the difference between reading (r), writing (w), and appending (a) modes in the
context of storing vehicle sensor logs.
5. Create a Python program that writes a formatted string containing a vehicle's details (make,
model, year) into a file using [Link]().
6. How can [Link] be used to check whether a vehicle log file exists before reading it?
7. Write a Python script to read an Excel sheet containing vehicle registration details using
openpyxl.
8. Write a program that extracts the list of electric vehicles from an Excel file and prints them.
9. Explain how the openpyxl module can be used to update an Excel spreadsheet containing
vehicle sales data.
10. Write a Python program to read a CSV file containing vehicle mileage data and print
the average mileage.
11. Create a script that removes the header from a CSV file containing car sales data.
12. Write a Python function to convert a dictionary containing car specifications into a
JSON string.
13. How can an API be used to fetch real-time fuel prices and store them in a JSON file?
14. Write a script that reads a JSON file containing vehicle insurance details and prints
them in a formatted way.
15. Explain the difference between CSV and JSON formats with an example of storing
vehicle manufacturing details.

Module4: Banking Domain - File Handling, Excel, CSV, and


JSON
1. Write a Python program to save customer bank transaction details into a text file and read
them back.
2. How can you use the shelve module to store and retrieve a customer’s account balance
securely?
3. Write a Python script that reads a bank statement stored in a text file and prints each
transaction separately.
4. Explain the difference between reading (r), writing (w), and appending (a) modes in the
context of storing banking transactions.
5. Create a Python program that writes a formatted string containing account details (name,
balance, account type) into a file using [Link]().
6. How can [Link] be used to check whether a customer's transaction file exists before
reading it?
7. Write a Python script to read an Excel sheet containing customer account details using
openpyxl.
8. Write a program that extracts a list of loan defaulters from an Excel file and prints their
details.
9. Explain how the openpyxl module can be used to update an Excel spreadsheet containing
bank loan records.
10. Write a Python program to read a CSV file containing daily bank transactions and
compute the total debit and credit amounts.
11. Create a script that removes the header from a CSV file containing bank customer
records.
12. Write a Python function to convert a dictionary containing bank account information
into a JSON string.
13. How can an API be used to fetch real-time exchange rates and store them in a JSON
file?
14. Write a script that reads a JSON file containing customer credit scores and prints
them in a structured format.
15. Explain the difference between CSV and JSON formats with an example of storing
customer loan details.

Module5: Automotive Domain - Classes and Objects


1. Define a Python class Car with attributes make, model, and year. Create an instance and
print its details.
2. Write a method inside the Car class that calculates the car's age based on the current year.
3. What is the purpose of the init method in a class? Implement it in a Vehicle class.
4. Write a Python class Engine that has attributes fuel_type and horsepower. Create
an instance and modify an attribute.
5. How can you use objects as return values? Provide an example of a CarFactory class that
creates and returns a Car object.
6. Write a Python program to demonstrate that objects are mutable by modifying a car’s
mileage attribute.
7. Implement a method inside the Car class that returns a formatted string representation of
the car details using str ().
8. Explain and implement operator overloading for the + operator to combine the mileage of
two Car objects.
9. Write a Python program to copy an object of the Car class using the copy module.
10. Create a Speedometer class with a method that returns the current speed of the
vehicle.
11. Define a Time class to represent the driving duration of a vehicle. Implement a
method to add two Time objects.
12. Implement a modifier method inside the Car class that increases the car's speed.
13. What is type-based dispatch in Python? Provide an example where different car
types (Electric, Diesel, Petrol) override a method.
14. Write a program to demonstrate polymorphism by creating a base class Vehicle
and derived classes Car and Truck.
15. Explain how interface and implementation differ using an example of a Vehicle
interface with an abstract method fuel_efficiency().

Module5: Banking Domain - Classes and Objects


1. Define a Python class BankAccount with attributes account_number,
account_holder, and balance. Create an instance and print its details.
2. Write a method inside the BankAccount class to deposit and withdraw money.
3. What is the role of the init method in a class? Implement it in a Customer class.
4. Write a Python class Loan that has attributes amount, interest_rate, and
duration. Create an instance and modify an attribute.
5. How can you use objects as return values? Provide an example of a Bank class that creates
and returns a BankAccount object.
6. Write a Python program to demonstrate that objects are mutable by modifying a bank
account’s balance.
7. Implement a method inside the BankAccount class that returns a formatted string
representation of the account details using str ().
8. Explain and implement operator overloading for the + operator to merge two
BankAccount balances.
9. Write a Python program to copy an object of the BankAccount class using the copy
module.
10. Create a Transaction class with a method that records a debit or credit
transaction.
11. Define a Time class to represent the maturity period of a fixed deposit. Implement a
method to add two Time objects.
12. Implement a modifier method inside the Loan class that increases the loan
tenure.
13. What is type-based dispatch in Python? Provide an example where different
account types (Savings, Current, Fixed Deposit) override a method.
14. Write a program to demonstrate polymorphism by creating a base class Account
and derived classes SavingsAccount and CheckingAccount.
15. Explain how interface and implementation differ using an example of a
BankService interface with an abstract method process_transaction().

You might also like