fork download
  1. def distance_from_zero(a):
  2. if type(a) == int or type(a) == float:
  3. return abs(a)
  4. else:
  5. return "Nope"
  6.  
  7. print distance_from_zero(-2)
  8. print distance_from_zero('hi')# your code goes here
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
2
Nope