Starlit Daily

📚 › Python: the friendliest first language

7. Making decisions

इस लेख का अनुवाद अपने आप होगा। अभी अंग्रेज़ी में दिखाया जा रहा है।

An if statement runs its block only when the condition is True. elif checks another condition and else handles everything else. Indent the block with four spaces: Python uses indentation to know which lines belong together.

Use == for equal and != for not equal.

उदाहरण देखें

marks = 65
if marks >= 80:
    print("A")
elif marks >= 50:
    print("B")
else:
    print("C")

✍️ अब आपकी बारी

Let temperature = 35. Print hot if it is above 30, otherwise mild.

← कोर्स पर वापस