# P5.4 Python and, or, not: Conditions एकत्र करा

Source: https://ravindrabagale.com/mr/datascience/py05-python-if-elif-else-statements-with-real-examples/p5-4-python-and-or-not-combine-conditions.html
Language: mr (Marathi with English technical terms)

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

खरे नियम दोन-तीन गोष्टींवर अवलंबून असतात: amount जास्त आणि member असेल तर free delivery.

हे काय आहे?

and म्हणजे दोन्ही खरे हवेत, or म्हणजे एक खरं पुरे, not उत्तर उलटं करतो.

कसं करायचं?

Step 1. प्रत्येक condition वेगळी लिहा.
Step 2. and/or ने जोडा.
Step 3. गोंधळ टाळायला कंस वापरा.

उदाहरण A: Free delivery नियम

```python
is_member = True
total = 42
if is_member and total > 30:
    print("Free delivery")
else:
    print("Delivery fee £3.99")
```

Output:

```text
Free delivery
```

याचा अर्थ: and मुळे दोन्ही conditions खऱ्या असतानाच free delivery मिळाली.

उदाहरण B: Weekend किंवा सुट्टी

```python
day = "Sunday"
is_holiday = False
if day in ("Saturday", "Sunday") or is_holiday:
    print("Extra staff needed")
```

Output:

```text
Extra staff needed
```

याचा अर्थ: or मुळे एकही condition खरी असली तरी True आलं.

उदाहरण C: not वापरणं

```python
is_paid = False
if not is_paid:
    print("Send payment reminder")
```

Output:

```text
Send payment reminder
```

याचा अर्थ: not ने True चं False आणि False चं True केलं.

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

pandas मध्ये and, or, not ऐवजी `&`, `|` आणि `~` लिहाल, प्रत्येक भागाभोवती brackets ठेवून. Logic तेच आहे.
