We require you to solve the following tasks. Remember to read the requirements first.
- Working with files
- Exception handling
- Decorators in Python
Final Notes: Remember to solve and send assignments on time ⏳
The sum
and divide
functions are given.
You must complete a decorator named @logger
.
The following information about the functions used by the decorators should be written in the form of logs in the file.
- names of function
- arguments
- call date
- function results
- error messages (if any)
Example:
def logger(f):
“““Write task solution here”””
pass
@logger
def sum(a,b):
return a+b
@logger
def divide(a,b):
return a/b
sum(1,2)
divide(a=4,b=2)
divide(10,0)
Powered by TechAcademy