Files
Mastering-Python-2e-code_2/CH_10_testing_and_logging/square.py
T
2022-05-05 18:25:55 +02:00

21 lines
289 B
Python

def square(n: int) -> int:
'''
Returns the input number, squared
>>> square(2)
4
Args:
n (int): The number to square
Returns:
int: The squared result
'''
return n * n
if __name__ == '__main__':
import doctest
doctest.testmod()