KIIT Polytechnic logo Students Hub KIIT Polytechnic Sign in
▲The Board ◆Notes ≡Syllabus ▦Timetable ?Doubts ▶Reels 🎮Learn 🐍Courses ◈Opportunities ✍Blog ▮Store ★Team ⌕Search
← Learn to Code — Python for Beginners Module · Making Decisions

Comparing things

Programs often need to compare two values and get True or False back — this is how they make decisions.

print(5 > 3)
print(5 < 3)
print(5 == 5)
print(5 != 3)

== (double equals) checks if two things are equal. This is different from the single = you used earlier to store a value — mixing these two up is one of the most common beginner mistakes, so it's worth remembering the difference now.