Home > Enterprise >  Infinite While loop flowchart
Infinite While loop flowchart

Time:09-23

while (True):
    a=int(input()) #input
    if(a<0):
        break

I wanted to create a program that loop until the user enters some value then the loop would break. Therefore I'm trying this way.I have to draw the flow chart too.

how to draw {while(True):} situation?

What will be the flowchart for this infinite while loop code?

CodePudding user response:

The input() function in Python is a blocking function. This means that the program will not terminate until the input() call returns, and this in turn won't return until the user provides an input. And this should be reflected in the flowchart.

The flowchart would look something like this:

flowchart

  • Related