Seedha content par jao
๐Ÿค– Python Hindi Bot
Namaste! Main Python Hindi Bot hoon ๐Ÿ
Python ya AI se related kuch bhi type karke pucho, ya neeche se quick sawaal chuno.
WhatsApp

Stay Connected with PythonHindii

Join our WhatsApp Community to get the latest Python tutorials, coding tips, interview questions, project updates, and learning resources directly on your phone.

Join WhatsApp Community
⇧
Python Hindi Logo
Python in Hindi | Programming Education

Python If Else in Hindi Explained | Complete Python Course Episode 17



```html

Python If Else in Hindi | เคธเคถเคฐ्เคค เค•เคฅเคจ (Conditional Statements) เค•ो เคธเคฎเคें

Python เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฎें Conditional Statements (เคธเคถเคฐ्เคค เค•เคฅเคจ) เคธเคฌเคธे เคฎเคนเคค्เคตเคชूเคฐ्เคฃ concepts เคฎें เคธे เคเค• เคนैं। เค‡เคธ เคฒेเค– เคฎें เคนเคฎ if, elif, เค”เคฐ else statements เค•ो เคตिเคธ्เคคाเคฐ เคธे เคธเคฎเคेंเค—े เค”เคฐ Complete Python Course เค•े Episode 17 เค•े เค†เคงाเคฐ เคชเคฐ practical examples เค•े เคธाเคฅ เคธीเค–ेंเค—े।

Python If Else เค•्เคฏा เคนै?

Conditional Statements เค•ा เค‰เคชเคฏोเค— เค•เคฐเค•े เคนเคฎ เค…เคชเคจे เคช्เคฐोเค—्เคฐाเคฎ เคฎें decision-making เค•ी เคธुเคตिเคงा เคœोเคก़ เคธเค•เคคे เคนैं। เคฏाเคจी เค•ि, เค…เคฒเค—-เค…เคฒเค— เคชเคฐिเคธ्เคฅिเคคिเคฏों เคฎें เค…เคฒเค—-เค…เคฒเค— code เค•ो execute เค•िเคฏा เคœा เคธเค•เคคा เคนै।

Python เคฎें เคฎुเค–्เคฏ เคฐूเคช เคธे เคคीเคจ เคช्เคฐเค•ाเคฐ เค•ी conditional statements เคนोเคคी เคนैं:

  • if statement - เคœเคฌ เค•ोเคˆ condition true เคนो เคคो code execute เค•เคฐเคจा
  • elif statement - multiple conditions เค•ो check เค•เคฐเคจा (else if)
  • else statement - เคœเคฌ เค•ोเคˆ เคญी condition true เคจ เคนो

Basic If Statement เค•ा เค‰เคชเคฏोเค—

if statement เค•ा เคธเคฌเคธे เคธเคฐเคฒ เค‰เคชเคฏोเค— เคนै เค•िเคธी condition เค•ो check เค•เคฐเคจा। เค…เค—เคฐ เคตเคน condition true เคนै, เคคो code block execute เคนोเค—ा।

Syntax:

if condition: # เคฏเคนाँ code เคฒिเค–ें เคœो execute เคนोเค—ा # เค…เค—เคฐ condition true เคนै

เค‰เคฆाเคนเคฐเคฃ 1: เคธเคฐเคฒ If Statement

age = 18 if age >= 18: print("เค†เคช adult เคนैं")

เค†เค‰เคŸเคชुเคŸ:

เค†เคช adult เคนैं

เคŠเคชเคฐ เคฆिเค เค—เค เค‰เคฆाเคนเคฐเคฃ เคฎें, age เค•ी value 18 เคนै। เคšूंเค•ि age >= 18 condition true เคนै, เค‡เคธเคฒिเค print() statement execute เคนुเค†।

If-Else Statement เค•ा เค‰เคชเคฏोเค—

เคœเคฌ เค†เคชเค•ो เคฆो เคตिเค•เคฒ्เคช (option) เค•े เคฌीเคš เคšुเคจाเคต เค•เคฐเคจा เคนो - เค…เค—เคฐ condition true เคนै เคคो เคเค• code, เค…เค—เคฐ false เคนै เคคो เคฆूเคธเคฐा code - เคคो if-else เค•ा เค‰เคชเคฏोเค— เค•เคฐें।

Syntax:

if condition: # เค…เค—เคฐ condition true เคนै print("เคฏเคน execute เคนोเค—ा") else: # เค…เค—เคฐ condition false เคนै print("เคฏเคน execute เคนोเค—ा")

เค‰เคฆाเคนเคฐเคฃ 2: If-Else Statement

marks = 35 if marks >= 40: print("เค†เคช pass เคนैं") else: print("เค†เคช fail เคนैं")

เค†เค‰เคŸเคชुเคŸ:

เค†เคช fail เคนैं

เค‡เคธ เค‰เคฆाเคนเคฐเคฃ เคฎें, marks เค•ी value 35 เคนै เคœ

๐Ÿง‘‍๐Ÿ’ป Python Coding Lab

Python code likho, run karo aur practice karo — directly browser mein.