PY-03-P1 Loops Flashcards
What are Loops?
Loops are blocks of code that run as long as the condition is true
A __ loop provides iterating capabilities
for loop
A ___ range, defined by r___( ) is also capable of iteration
set range, range( )
The ___ function returns the number of items of an object
len( )
The r___( ) function accepts an integer and returns the range of the object
range( )
If a condition is false, the ___ loop will not be executed
while loops
The ____ command exits a loop
break
Behaves as if the code reached the end of the block
continue command
the _____ command skips an iteration
continue command
____ statements are used as empty executions
pass statements
A loop becomes ____ if a condition is never False
Infinite Loops
the ____ function can be used to define a list within another list
append( )
adds a value to an existing variable
append( )
N __ lists can be used to arrange data in hierarchical structiures
nested
constructs an integer number casted from a string or float
int( )