Home Work 11
17th May 2024
This is our eleventh homework assignment where you will address the following questions and submit your GitHub link containing either a Jupyter Notebook or a Python file
Question 1 -
Write a Python function called calculate_discount_price
that takes two parameters: price
and discount_rate
. The function should calculate the discounted price based on the given price and discount rate, and return the discounted price.
Question 2
Create a Python function called generate_operations
that takes two numbers a
and b
as parameters. Inside generate_operations
, define an inner function
called perform_operations
that takes the same parameters a
and b
, and returns the result of three operations: addition
, subtraction
, and multiplication
of a and b. Finally, the generate_operations
function should return the result obtained from the perform_operations function
.
———————————————— Happy Learning —————————————————–