Python Logical Operators in Hindi ๐ฅ | and, or, not Explained | Python Course 2026 Episode 14
Python เคฎें Logical Operators: and, or, not เคी เคธंเคชूเคฐ्เคฃ เคाเคเคก
เคจเคฎเคธ्เคคे! เคเค เคนเคฎ Python เคे เคธเคฌเคธे เคฎเคนเคค्เคตเคชूเคฐ्เคฃ topics เคฎें เคธे เคเค เคे เคฌाเคฐे เคฎें เคฌाเคค เคเคฐेंเคे - Logical Operators। เคฏเคฆि เคเคช Python เคธीเค เคฐเคนे เคนैं เคคो เคฏเคน concept เคเคชเคे เคฒिเค เคฌเคนुเคค เคเคฐूเคฐी เคนै। Logical operators เคा เคเคชเคฏोเค เคเคฐเคे เคเคช complex conditions เคฌเคจा เคธเคเคคे เคนैं เคเคฐ เค เคชเคจे programs เคो เค เคงिเค powerful เคฌเคจा เคธเคเคคे เคนैं।
Logical Operators เค्เคฏा เคนैं?
Logical operators เคा เคเคชเคฏोเค boolean values (True/False) เคे เคธाเคฅ เคाเคฎ เคเคฐเคจे เคे เคฒिเค เคिเคฏा เคाเคคा เคนै। เคฏे operators เคเคชเคो multiple conditions เคो combine เคเคฐเคจे เคฎें เคฎเคฆเคฆ เคเคฐเคคे เคนैं। Python เคฎें เคฎुเค्เคฏเคคः เคคीเคจ เคช्เคฐเคाเคฐ เคे logical operators เคนोเคคे เคนैं:
- and - เคฆोเคจों conditions เคो check เคเคฐเคคा เคนै
- or - เคเคฎ เคธे เคเคฎ เคเค condition เคो check เคเคฐเคคा เคนै
- not - condition เคो reverse เคเคฐเคคा เคนै
1. AND Operator เคो เคธเคฎเคें
and operator เคคเคฌ True return เคเคฐเคคा เคนै เคเคฌ เคฆोเคจों conditions True เคนों। เค เคเคฐ เคोเค เคญी เคเค condition False เคนै เคคो result False เคนोเคा।
AND Operator เคा Syntax:
condition1 and condition2
AND Operator เคे Truth Table:
- True and True = True
- True and False = False
- False and True = False
- False and False = False
AND Operator เคा เคต्เคฏाเคตเคนाเคฐिเค เคเคฆाเคนเคฐเคฃ:
# เคเคฆाเคนเคฐเคฃ 1: Simple AND operation
age = 25
marks = 85
if age >= 18 and marks >= 80:
print("เคเคช scholarship เคे เคฒिเค eligible เคนैं!")
else:
print("เคเคช scholarship เคे เคฒिเค eligible เคจเคนीं เคนैं।")
# Output: เคเคช scholarship เคे เคฒिเค eligible เคนैं!
# เคเคฆाเคนเคฐเคฃ 2: Multiple conditions เคे เคธाเคฅ AND
username = "admin"
password = "12345"
if username == "admin" and password == "12345":
print("เคฒॉเคिเคจ เคธเคซเคฒ เคฐเคนा!")
else:
print("เคเคฒเคค username เคฏा password")
# Output: เคฒॉเคिเคจ เคธเคซเคฒ เคฐเคนा!
# เคเคฆाเคนเคฐเคฃ 3: Variable assign เคเคฐเคคे เคนुเค
x = 10
result = (x > 5) and (x < 15)
print(result) # Output: True
2. OR Operator เคो เคธเคฎเคें
or operator เคคเคฌ True return เคเคฐเคคा เคนै เคเคฌ เคเคฎ เคธे เคเคฎ เคเค condition True เคนो। เคฆोเคจों conditions False เคนोเคจे เคชเคฐ เคนी result False เคนोเคคा เคนै।
OR Operator เคा Syntax:
condition1 or condition2
OR Operator เคे Truth Table:
- True or True = True
- True or False = True
- False or True = True
เคोเค เคिเคช्เคชเคฃी เคจเคนीं:
เคเค เคिเคช्เคชเคฃी เคญेเคें