Syntax of answer in 5.14

def greater_less_equal_5(**answer**):
    if **answer** > 5:
        return 1
    elif **answer** < 5:          
        return -1
        return 0

Hello, this is my first post, I am enjoying learning Python with Codeacademy. Everyone has been very friendly so far, in my opinion.

My question is about why the word answer does not have any quotations or parentheses around it. Is it a string? Or is answer used by itself? I may be jumping ahead of myself.



Please re-edit your Post

  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.



def greater_less_equal_5(answer):
    if answer > 5:
        return 1
    elif answer < 5: 
        return -1
        return 0

you have defined a greater_less_equal_5 function
which take's 1 parameter answer
( the parentheses-( ) are also called parameter-holders )
answer is used as a variable throughout the function.

Now as you call the greater_less_equal_5 function
and the greater_less_equal_5 function was defined as having 1 parameter
you will have to provide 1 argument which in this case should be a number Value
if we had a variable to which a number Value was assigned
number_to_check = 10
we could have called the greater_less_equal_5 function

some quotes from the outer-world:

**argument is the value/variable/reference being passed in,
parameter is the receiving variable used within the function/block**


**"parameters" are called "formal parameters",
while "arguments" are called "actual parameters".**


Thank you for the explanation, this definitely helps explain some of the gaps for me.