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

#nested if

if -100<=num:

print("Three digit Negative Number")


Output:

Negative Number

Three digit Negative Number

Nested If else program video:





8 views0 comments

Recent Posts

See All

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