unable to get output:
def distance_from_zero(a):
if type(a)==‘int’ or type(a)==‘float’:
c=abs(a)
return c
else:
return ‘nope’
print(distance_from_zero(-10))
unable to get output:
def distance_from_zero(a):
if type(a)==‘int’ or type(a)==‘float’:
c=abs(a)
return c
else:
return ‘nope’
print(distance_from_zero(-10))
Problem exists in this line of code
type(a)=='int' or type(a)=='float':
its just int and float not ‘int’ and 'float’
hint**
type(x) == int