Table of Contents
Python Tutorial
Table of Contents
Python Tutorial
Conditional Statements in Python in Hindi
What is Conditional Statements in python
python में decision making के लिए If-else conditional statement का use करते हैं, यह specific conditions के basis पर code के different block को execute करते हैं, if-else का use करके हम program के flow को dynamically control कर सकते हैं.
How if-else work

What is If Statement
यह condition को check करता है अगर condition true हुई तो if block execute हो जाता है अगर condition true नहीं हुई तो if block का execution नहीं होता है
What is Else Statement
अगर if condition false होती है तो else block का execution होता है.
इसे एक Example se समझते हैं
What is Elif Statement
python में multiple condition को check करने के लिए elif statement का use करते हैं जब एक से ज्यादा conditions को sequencely check करना होता है तो इसका use किया जाता है
How elif works :
इसका use if and else के बीच में किया जाता है हम अपने जरूरत के हिसाब से multiple elif का Use करते हैं अगर if condition false हो जाती है तो elif block का execution होता है अगर हमने अपने program में एक से ज्यादा elif का use किया है तो जो condition सही होगा उस elif block का execution होगा
इसे एक example के through समझते हैं :
What is Nested if-else
जब हम किसी if condition के अंदर भी कोई condition check Karte Hain तो इसे nested if else कहते हैं
What is Ternary Operator
अगर python में हम conditional expression को एक लाइन में लिखने चाहे तो Ternary operator का use करना होता है इसमें value और condition और statement एक ही लाइन में लिख सकते हैं जैसा की syntax में दिया गया है
आइए इसे एक example की help समझते हैं
उम्मीद करते है कि आपको conditional statements in python अच्छे समझ मे आ गया होगा । अपने learning को continue रखने के लिए next button पर click करे,
- All Posts
- Artificial Intelligence
- Computer Fundamentals
- Computer Networks
- Data Analytics
- Data Science
- DBMS
- Deep Learning
- Digital Electronics
- DSA with Python
- Excel
- Exercise
- Git & Github
- Machine Learning
- Matplotlib
- Natural Language Processing
- NumPy
- Operating System
- Pandas-s
- Power BI
- Python Tutorial
- Scikit-learn
- Seaborn
- SQL & MySQL

Table of Contents All Chapters 1. Personal Area Network 2. Local Area Network 3. Campus Area Network 4. Metropolitan Area...

Table of Contents All Chapters 1. Data Communication 2. Types of Data Communication 2.1. Simplex 2.2....

Table of Contents All Chapters 1. Special Logic Gate 2. XOR Gate 2.1. XOR Gate Truth Table 3....

Table of Contents All Chapters 1. Universal Logic Gates 2. NOR Gate 2.1. NOR Gate Truth Table 3....

Table of Contents All Chapters 1. Logic Gate 2. AND Gate 2.1. AND Gate Truth Table 3. OR...

Table of Contents All Chapters 1. Simplification 2. Simplification using Boolean Algebra Theorems 3. Simplification using K-map Digital Electronics...

Table of Contents All Chapters 1. Identity Laws 2. Null Laws 3. Domination Laws 4. Idempotent Laws 5. Complement Laws...