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 करे,

Add a comment...

  • 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
computer networks

Table of Contents All Chapters 1. OSI Model      1.1. Physical Layer      1.2. Data Link Layer  ...

computer networks

Table of Contents All Chapters 1. Topology 2. Types of Topology      2.1. Point to Point Topology    ...

computer networks

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

digital electronics number system

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

Edit Template

Sign up to track your learning

Login to continue your learning tracking

To reset your password, please enter your email address or username below.

Scroll to Top