What am I doing wrong?


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python

def distance_from_zero(l):
if type(l) == int or float:
return abs(l)
else:
return “Nope”

<do not remove the three backticks above>

#2

you have to have a comparison in both cases, many people seem to cut this corner:

if type(l) == int or type(l) == float:

See? in both cases you have to compare. There is a programmers joke about this: Mother to son: Son, go to the market. Bring one bottle of milk, if they have eggs, bring 6. Son came home with 6 bottles of milk, the mother was surprised. Well, they had eggs so i bought 6. The joke relies on this principal, you didn’t double check the condition. I know, terrible joke, too tempting


#3

thx alot it helped me