# P5.3 Python elif: अनेक conditions तपासणं

Source: https://ravindrabagale.com/mr/datascience/py05-python-if-elif-else-statements-with-real-examples/p5-3-python-elif-checking-many-conditions.html
Language: mr (Marathi with English technical terms)

हे का शिकायचं?

दोनपेक्षा जास्त पर्याय असतात — fast, normal, late delivery किंवा low, medium, high risk.

हे काय आहे?

elif म्हणजे "नाहीतर जर". Python वरून खाली तपासतो आणि पहिली True condition सापडली की बाकीच्या सोडून देतो. म्हणून क्रम महत्त्वाचा.

कसं करायचं?

Step 1. सगळ्यात कडक condition आधी लिहा.
Step 2. मग elif लिहा.
Step 3. शेवटी else ने उरलेले सगळे पकडा.

उदाहरण A: Delivery speed bands

```python
minutes = 25
if minutes <= 15:
    band = "Super fast"
elif minutes <= 30:
    band = "Fast"
elif minutes <= 60:
    band = "Normal"
else:
    band = "Slow"
print(band)
```

Output:

```text
Fast
```

याचा अर्थ: पहिली True condition वाली band मिळाली.

उदाहरण B: क्रम महत्त्वाचा

```python
minutes = 10
if minutes <= 60:
    band = "Normal"
elif minutes <= 15:
    band = "Super fast"
else:
    band = "Slow"
print(band)
```

Output:

```text
Normal
```

याचा अर्थ: Conditions चा क्रम चुकला की चुकीचं उत्तर येतं. मोठी मर्यादा आधी तपासा.

उदाहरण C: Score वरून loan risk

```python
score = 710
if score >= 750:
    risk = "Low"
elif score >= 650:
    risk = "Medium"
else:
    risk = "High"
print(f"Score {score}: {risk} risk")
```

Output:

```text
Score 710: Medium risk
```

याचा अर्थ: elif च्या साखळीने score ला risk level मिळाली.

रवींद्र बागले यांची tip

आधी कागदावर bands चा छोटा table लिहा (पासून, पर्यंत, label). मग elif chain आपोआप लिहिली जाते.
