FINALE LESSONS Flashcards
With the ________ we can execute a set of statements as long as a condition is true.
While loop
With the _____________ we can stop the loop even if the while condition is true
break statement
With the ______________ we can run a block of code once when the condition no longer is true
else statement
With the ______________ we can stop the current iteration, and continue with the next:
continue statement
A __________ is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
for loop
With the ___________ we can execute a set of statements, once for each item in a list, tuple, set etc.
for loop
The for loop ____________ an indexing variable to set beforehand.
does not require
The ___________ in a for loop specifies a block of code to be executed when the loop is finished
else keyword
A __________ is a loop inside a loop.
nested loop
The __________ returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and ends at a specified number.
range() function
for loops cannot be empty, but if you for some reason have a for loop with no content, put in the _____________ to avoid getting an error.
pass statement
In Python a function is defined using the ____________
def keyword
The terms __________ and ___________ can be used for the same thing: information that are passed into a function.
parameter & argument
A parameter is the variable listed inside the parentheses in the function definition.
An argument is the value that is sent to the function when it is called.