program structure and control flow if no action is to be takenyou can omit both the else and elif clauses of conditional use the pass statement if no statements exist for particular clauseif expressionpass elsestatements do nothing loops and iteration you implement loops using the for and while statements here' an examplewhile expressionstatements for in sstatements the while statement executes statements until the associated expression evaluates to false the for statement iterates over all the elements of until no more elements are available the for statement works with any object that supports iteration this obviously includes the built-in sequence types such as liststuplesand stringsbut also any object that implements the iterator protocol an objectssupports iteration if it can be used with the following codewhich mirrors the implementation of the for statementit _iter_ (get an iterator for while tryi it next(get next item (use _next_ in python except stopiterationno more items break perform operations on in the statement for in sthe variable is known as the iteration variable on each iteration of the loopit receives new value from the scope of the iteration variable is not private to the for statement if previously defined variable has the same namethat value will be overwritten moreoverthe iteration variable retains the last value after the loop has completed if the elements used in iteration are sequences of identical sizeyou can unpack their values into individual iteration variables using statement such as the followingfor , , in sstatements in this examples must contain or produce sequenceseach with three elements on each iterationthe contents of the variables xyand are assigned the items of the corresponding sequence although it is most common to see this used when is sequence of tuplesunpacking works if the items in are any kind of sequence including listsgeneratorsand strings when loopingit is sometimes useful to keep track of numerical index in addition to the data values here' an examplei for in sf lib fl ff