Python If Else Statements

In python if..else statements is execute two time like if or else,if condition id true than execute if part when execute else part in the program.

The following syntax or example of if..else statements in python

							
if test expression
	body of if
else:
	body of else
							
							

Example

							
a = -5;

if a >= 0:
	print("This Number is Positive");
else:
	print("This Number is Negative");
							
							
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!