//sample solution
def distance_from_zero(param):
if (type(param) is int) or (type(param) is float):
return abs(param)
else:
return "This isn't an integer or a float!"
print distance_from_zero(-1)
print distance_from_zero(-2.13)
print distance_from_zero("A string.")
No comments:
Post a Comment