Relational Operators

Examples

Example 1: Comparing Heights

height_nihar = 180
height_harsha = 175

is_taller = height_nihar > height_harsha
print(f"Is Dodagatta Nihar taller than Harsha? {is_taller}")

Output:

Is Dodagatta Nihar taller than Harsha? True

Example 2: Checking Age

age_praveen = 28
age_vasanta = 30

older = age_praveen < age_vasanta
print(f"Is Praveen younger than Vasanta Kumar? {older}")

Output:

Is Praveen younger than Vasanta Kumar? True