I do not get 19/19


#1

My code is:

def distance_from_zero():
type = int or float
return abs()
elsif:
return "Nope"

I does not let me pass. It says:

Oops, try again. Your function seems to fail on input True when it returned '1' instead of 'Nope'


#2

Hi @aduan1234,

A few comments regarding your code:

1.. Your function should take a parameter when it is being defined. As per the instructions, "First, def a function called distance_from_zero, with one argument (choose any argument name you like)."

2..It should not be an equal sign here because you are not assigning a variable to a name:

Do you know what sign you should use instead?

3.. You should have employed an if statement here:

While doing your if statement, be sure not to just do if type = int or float. If you are not sure why, here's a post by a codecademy moderator: https://discuss.codecademy.com/t/faq-how-not-to-compare-multiple-values-using-if-condition/42543. Even though it is a different language the same principles apply.

4.. You mistyped elif:

Give it another shot! :slight_smile:


#3

Thanks for the help!


#4

you're welcome :slight_smile: Remember to check this question as solved :slight_smile:


#5

One thing that I noticed is that you used an elsif statement, but you never started it with and if statement.