From b8ebb1472c4d3a2f474fb7142f82e875166f06e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Wed, 31 Oct 2018 13:48:13 +0100 Subject: [PATCH] Added exercise 5 --- ex_05.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ex_05.py diff --git a/ex_05.py b/ex_05.py new file mode 100644 index 0000000..ea8f265 --- /dev/null +++ b/ex_05.py @@ -0,0 +1,17 @@ +#!/usr/bin/python3 + +from math import sqrt as rsqrt +from cmath import sqrt as csqrt + +print("I am going to compute the square root of 8") +sqrt = rsqrt(8) +print("The result is", sqrt) + + +print("I am going to compute the square root of -4") +sqrt = csqrt(-4) +print("The result is", sqrt) + +# Note that ``callable(obj)`` returns whether ``obj`` is a +# callable, i.e. is a function or method or has a ``__call__` +# method.