Visual Studio Code and Python

Hi All,

I have an issue where I run a simple program with >= and I keep getting a:

code:

def maxnum(num1, num2, num3):

if num1 is > num2 and num1 > num3:

    return num1

elif num2 > num1 and num2 > num3:

    return num2

else:

    return num3

print(maxnum(3, 4, 5))

output error message:

if num1 is > num2 and num1 > num3:
           ^

SyntaxError: invalid syntax
PS C:\Users\tenfo\OneDrive\1. Architecture\8. Python>

Would Appreciate any help.

Best,

Felix

1 Like

You’re using “is >” instead of “>=”.

1 Like

Thanks so much! What a stupid thing to do!

1 Like