Account
Categories

Greater Than or Equal to Operator (>=)


Definition:

It is a relational operator used in a programming language.

If you want to check whether the value of the left operand is greater than or equal to the right operand, you use the greater than or equal to operator (>=).

If it finds the condition true, then it returns True; otherwise, it returns False.

Syntax:

a >= b

Example:

marks = 40

if marks >= 40:
    print("Student Passed")
else:
    print("Student Failed")

Output:

Exercise

Create a variable age = 18 and check whether age is greater than or equal to 18 using the >= operator.