Add a logger to the hypotenuse function. Use the appropriate log level to output the info. The log message should have the form: level -> message, where the message should have the following form: Hypotenuse of a and b is h
Logging
Log the info
Report a typo
Sample Input 1:
2 5Sample Output 1:
INFO -> Hypotenuse of 2 and 5 is 5.39Write a program in Python 3
import logging
# initialize the logger
...
def hypotenuse(a, b):
h = round(((a ** 2 + b ** 2) ** 0.5), 2)
# call the logger
...
return h
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.