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 Control Flow and Python tutorials Bestitworriors
Python Control Flow
Python Control Flow and Python tutorials Bestitworriors - Control flow use to control the program and how it work.How flow of program like where input certein condations where program execute and how many time these lines should be execute.if-else statements,Switch Statements,Else if Statement,Iterative or looping Structure,While Loop,Do-while loop,For loop,Nested loop,Sequential Control Flow Structure,jump statements,Break statement,Continue statement .These ara all control flow in Python
Some Key Points of Python Control Flow
- Control Fow use to control the program flow
- Python if
- Python if-else
- Python else if
- Python for loop
- Python while loop
- Python Do-while Loop
- Python Nested loop
- Python Break Statement
- Python Continue Statement
Code
var1 = 1
while var1 < 6:
print(var1)
var1 += 1
Months = ["January", "Feburary", "March", "April", "May", "June", "Jully"]
for x in Months:
if x == "January":
continue
if x == "June":
break
print(x)
def numbers_to_months(argument):
switcher = {
1: "january",
2: "Feburary",
3: "March",
4: "April",
5: "May",
6: "June",
7: "Jully",
8: "August"
}
return switcher.get(argument, "nothing")
# Driver program
if __name__ == "__main__":
argument = 4
print(numbers_to_months(argument))
OutPut
1
2
3
4
5
Feburary
March
April
May
April
0 Comments