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 loops and control flow  | Python tutorials  Bestitworriors



Python loops and control flow

Python tutorials


Python loops and control flow  | Python tutorials  Bestitworriors - Loop are use to repeat the specific part of code in number of iteration given.Loop are use to print the code in multiple time as you want.Python support for loops and while loops and etc much more.Loop will iterate untill react to given number of iterations.




Some Key Points of Python Loops



  1. Loops iterate untill specific condation match
  2. Python support while loop
  3. Python support for loop
  4. For Loop iterate array also
  5. Loop contain break and continue statements
  6. Break statement will break the loop on given condation
  7. Continue statement switch the given iteration
  8. We can use else part to while loop when while end then else part will execute



Code


var1 = 1
while var1 < 6:
print(var1)
var1 += 1


var2 = 1
while var2 < 6:
print(var2)
var2 += 1
else:
print("Var2 is no longer less than 6")



Months = ["January", "Feburary", "March", "April", "May", "June", "Jully"]
for x in Months:
if x == "January":
continue
if x == "June":
break
print(x)







OutPut


1
2
3
4
5
1
2
3
4
5
Var2 is no longer less than 6
Feburary
March
April
May



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 loops and control flow  | Python tutorials  Bestitworriors