Python Programming Tutorial | Python Control Flow Tools

Python – Control Flow

In the programs we have seen till now, there has always been a series of statements faithfully executed by Python in exact top-down order. What if you wanted to change the flow of how it works? For example, you want the program to take some decisions and do different things depending on different situations, such as printing ‘Good Morning’ or ‘Good Evening’ depending on the time of the day?

As you might have guessed, this is achieved using control flow statements. There are three control flow statements in Python – if,for and while and are discussed as –

  • The if statement
  • The while statement
  • The for loop
  • The break and continue statement

Apply for Govt Certified Python Certification Now!!

Go back to Tutorial                                                                                Go to Home Page

Get industry recognized certification – Contact us

Menu