Lesson 7 of 34

तुलना: True या False

6 min 20 XP

जब आप दो मानों की तुलना करते हैं, Python जवाब True या False में देता है। इन्हें Booleans कहते हैं।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

= मान रखता है (assign)। == पूछता है “क्या ये बराबर हैं?” (compare)। इन्हें आपस में मत मिलाइए!

आप strings की तुलना भी कर सकते हैं, पर बड़े-छोटे अक्षर मायने रखते हैं: "Chennai" और "chennai" बराबर नहीं हैं।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

Challenge

+20 XP

price = 499 और budget = 500 है। पहली लाइन में print करें कि price, budget से कम है या नहीं (<)। दूसरी लाइन में print करें कि price, 500 के बराबर है या नहीं (==)।

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.