Blog Introductions


In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services. Python if-else and Control Flow  |  Python tutorials  Bestitworriors


Python if-else and Control Flow

Python tutorials






Python if-else and Control Flow  |  Python tutorials  Bestitworriors - Python if-else use to execute pice of code if some condation match to criteria . If-else use to check condation if condation match the execute If(Condation == true)then execute If block code // then after that we can check further condatio using else if(Condation ==true)if match then execute //Code part if none of condation match then execute the else part code //Code.




Some Key Points of Python IF-Else




  1. Python use to execute pice of code on condation match
  2. Use if Condation to check condation if(cond == true){//code}
  3. Use else if condation to check further condation else if (cond == true) {//Code}
  4. If none of condation match the execute the else part else{//Code}
  5. Elif condation also work same as else if




Code




var1 = 33
var2 = 33
if var1 > var2:
print("var is greater than var2")
elif var1 == var2:
print("a and b are equal")

var3 = 10
var4 = 5
if var3 > var4:
print("var3 is greater than var4")
elif var3 == var4:
print("var3 and var4 are equal")
else:
print("var3 is less than var4")









OutPut



a and b are equal
var3 is greater than var4







I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Python if-else and Control Flow  |  Python tutorials  Bestitworriors