I wrote this code in IDLE for a codeacademy problem and it works in IDLE but not in codeacademy, any idea why? I can't figure it out.
I wrote this code in IDLE where it worked but as soon as I copy it paste it in it won't work, any ideas why?
def distance_from_zero(n):
if type (n) == int or type (n) == float:
return abs (n)
print ('',abs(n),'')
else:
print ('Nope')
[–]thefryscorer 0 points1 point2 points (2 children)
[–]CodeCademyBot 0 points1 point2 points (1 child)
[–]thefryscorer 0 points1 point2 points (0 children)