Nested if Statement :-
Nested if statement Python में एक Conditional Statement (शर्तीय कथन) है, जिसमें एक if statement के अंदर दूसरा if statement लिखा जाता है। इसका उपयोग multiple conditions को step-by-step check करने के लिए किया जाता है।
सबसे पहले बाहरी if की condition check होती है। यदि वह condition True (सही) होती है, तभी उसके अंदर मौजूद दूसरा if statement check किया जाता है।
यदि बाहरी if condition False (गलत) होती है, तो उसके अंदर का पूरा code execute नहीं होता।
Python में Nested if के प्रत्येक block में Indentation (रिक्त स्थान) देना आवश्यक होता है। सामान्यतः प्रत्येक level के लिए 4 spaces का indentation प्रयोग किया जाता है।
English
A Nested if statement is a conditional statement in Python in which one if statement is placed inside another if statement. It is used to check multiple conditions step-by-step.
First, the outer if condition is checked. If it is True, the inner if statement is checked.
If the outer if condition is False, the code inside it is not executed.
In Python, proper Indentation (spaces) is required for each nested block. Generally, 4 spaces are used for each level of indentation.