[Python] Comparison with If statement

This time you can make comparison function; with return & If statement

def num(n1, n2, n3):
    if n1 >= n2 and n1 >= n3:
        return n1
    elif n2 >= n1 and n1 >= n3:
        return n2
    else:
        return n3

print(num(13,40,5))

You're going to get "40"

in python,  equal sign is "==", not equal is "!="

!=
==


 

Popular posts from this blog

[Python] Dictionary

[Visual Design 2/3]

[JavaScript] For loop , Function