A statement that contains other statements is called a compound statement. to perform more complex checks if statements can be nested that is can be placed one inside the other. in such a scase the inner if statements is the statement part of the outer one nested if statements are used to check if more than one condition is satisfied.
Syntex of python if else statement
else [Block D]
else [Block E]
Note: "if the cond1 is evaluated to true, the next inner if statement is executed. The cond2 is checked for true or false.
if it is evaluated to true, then the statement in block C are executed otherwise, the statements in BlockD are executed.If above cond1 is not true then statement in Block E is executed."
Q.) W.A.P to print the greater number using simple if-else statement.
a=int(input("Enter first Number"))
b=int(sinput("Enter Second Number"))
print(“Max = %d”,c);