Nested If else statement in Python

Updated: May 18, 2020


If statement is within another if statement then this is called nested of control statements.

Example

num = -100

if num > 0:

print("Positive Number")

else:

print("Negative Number")

#nested if

if -100<=num:

print("Three digit Negative Number")


Output:

Negative Number

Three digit Negative Number



7 views0 comments

Recent Posts

See All

Python Modules

A module is a file containing Python definitions and statements. A module can characterize functions, classes and variables. A module can likewise incorporate runnable code. Gathering related code int

 

9555593818

Thakurdwara, Uttar Pradesh 244601, India

  • Facebook
  • Twitter
  • LinkedIn