Advertisement



< Prev
Next >


Python If-Else statement





After discussing the if statement of Python language in our previous article, we are going to discuss another important conditional statement known as if-else. In the if-else conditional statement, the condition in the parenthesis of if statement is evaluated for a boolean value - true or false.





Important points - if-else statement





Advertisement




Python - if else example


#Python - if-else condition statement program
  

if(100>50):
	print("100 is greater than 50")
else:
	print("100 is less than 50")
print("Outside if-else block")
  


Output -

100 is greater than 50
Outside if-else block 




Program Analysis





Please share this article -





< Prev
Next >
< Python if statement
Python elif statement >



Advertisement

Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement



Notifications



Please check our latest addition

C#, PYTHON and DJANGO


Advertisement