Generally हम अपना काम करते समय कुछ condition का use करते हैं जैसे कि आप जब Government Job के लिये Apply करते हैं। तो आप देखते हैं कि वहाँ पर भी कुछ condition होती हैं। जैसे कि Age की condition, जिनकी age 18 से 30 के बीच में होगी वही सिर्फ job के लिये apply कर सकते हैं या कहें Education में जो Graduate हैं वही सिर्फ Apply कर सकते हैं। वैसे ही Programming के अन्दर हमें कुछ ऐसा ही करना होता है जैसे कि programming code execute करना है उसके लिये particular condition true हुई तो ये code execute होना चाहिये। इसी तरह की condition के लिये हम conditional statement का use करते हैं।
- Python Program to find largest of two numbers
- Python program to find largest and equal of two numbers
- Python program for performing an arithmetic operations
- Python program to print whether a given character is an upper case or a lower case character or a digit or any other character
- और Programs के लिये यहाँ click करें।
ये conditional statement हमें जैसे हम कुछ भी Statement लिखते हैं उसको True और False Expression में return करता है अगर हमारी condition True हुई तो Block के अन्दर लिखा हुआ statement execute करेगा और अगर condition false है तो True वाली condition को skip कर देगा और बचे हुए program को Run करेगा। हम चार तरह के conditional statement के बारे में सीखेंगे।
इन्हें भी देखें।
Python Programs के लिये यहाँ click करें।