Lesson 9 of 34

elif: दोनपेक्षा जास्त पर्याय

8 min 25 XP

दोनपेक्षा जास्त पर्याय असतील तर elif (else if) वापरा. Python वरून खाली तपासते आणि जो भाग सर्वात आधी True असेल तोच चालवते.

Example: edit me and press Run

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

क्रम महत्त्वाचा! सर्वात मोठी मर्यादा (>= 35) आधी ठेवा, नाहीतर 40 सुद्धा “Warm” print करेल.

हे दुकानातील सवलतीचे उदाहरण आहे. Input box मध्ये वेगवेगळ्या रकमा टाकून पाहा.

Example: edit me and press Run

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

Challenge

+25 XP

input() ने marks वाचा आणि grade print करा: 90 किंवा जास्त → A 75 किंवा जास्त → B 50 किंवा जास्त → C बाकी सर्व → Fail

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