Unit 3 Lesson 7 Nested Conditionals
if conditionA:
# Code here executes when 'conditionA' is True
else:
# Code that runs when 'conditionA' is False
if conditionB:
# Code that runs when 'conditionA' is False
# and 'conditionB' is True
n=int(input('Enter marks: '))
# checking the conditions
if n>=75:
if n >=95:
print('Excellent')
else:
print('Pass')
else:
print('Fail')
- If Else Statements can be put inside of another if else statement using this layout for psuedo code.
if (condition 1)
if (condition 2)
#first block of statement
else
#second block of statement
else
if (condition 3)
#third block of statement
else
#fourth block of statement
def function(x, y, z):
if()
#Code here
if()
#Code here
else
#Code here
else
if()
#Code here
else
#Code here