Log the info

Report a typo

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

Sample Input 1:

2 5

Sample Output 1:

INFO -> Hypotenuse of 2 and 5 is 5.39
Write 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
___

Create a free account to access the full topic