పూర్తి అవసరాలను
2. if-else Statement
In Python, the if..else statement has two blocks: one for when the condition is True and another for when the condition is False.
Syntax:
if expression :
statement_1
statement_2
....
else :
statement_3
statement_4
....
If the expression is True, the statements after if are executed; otherwise, the statements after else are executed. In the following example the program will print the second print statement as the value of a is 10.
Output:
Value of a is 10
"Python if elif else" by w3resource is licensed under CC BY-SA 4.0