Added exercise 5
This commit is contained in:
parent
4521da88cc
commit
b8ebb1472c
17
ex_05.py
Normal file
17
ex_05.py
Normal file
|
@ -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.
|
Loading…
Reference in New Issue
Block a user