""" Exercise 1.5 - Pythagora's Theoreme """ # Copyright (c) 2021. Pascal Syma. All rights reserved. import math def pythagoras(_a, _b): """ Calculate the hypotenuse for a right-angle triangle. :return: Length of hypotenuse :param _a: Length of first side :param _b: Length of second side """ return math.sqrt(_a ** 2 + _b ** 2) if __name__ == '__main__': for i in [[2, 3], [3, 4], [0, 0]]: print(f'{i[0]}² + {i[1]}² = {pythagoras(i[0], i[1])}²')