vendredi 30 juin 2017

Python code for conditional operators. What will be the output of the following code?

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

print greater_less_equal_5(5)
print greater_less_equal_5(6)
print greater_less_equal_5(7)

Aucun commentaire:

Enregistrer un commentaire