Nested If else statement in Python
top of page

Nested If else statement in Python

Updated: May 25, 2021


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")

if -100<=num:

print("Three digit Negative Number")


Output:

Negative Number

Three digit Negative Number

Nested If else program video:





Recent Posts

See All

Tell function in python with example

Tell () function can be used to get the position of file handle and returns current position of file object where as Seek () function is used to change the position of the file handle to a given speci

Seek function in python with example

Seek () function is used to change the position of the file handle to a given specific position in python. File handle such as a cursor which defines from where the data has to be read or written in t

bottom of page