sqrt2 int input triggers AssertionErrorassumed as int not
Issue #2
new
If I try a simple mysqrt.sqrt2(2) triggers and assertion error from code: uwhpsc / lectures / lecture4 / mysqrt.py > line 17 assert x>0. and type(x) is float, "Unrecognized input" mysqrt.sqrt2(2,) works just find. I'm using Python version 2.7.5+
Comments (2)
-
-
repo owner Yes, it's written to expect a float but not an int. It could be improved by changing the assertion to
assert x>0. and (type(x) in [float,int]), "Unrecognized input"
- Log in to comment
I was the one creating the issue/question. I forget to log in