Conditional Structures
I LOVE DOING THIS :)
Basic control flows
Selection (if statements)
Iteration (for loops)
What are For Loops ?
The for
statement line will end with a colon :
and the rest of the code block must be indented with a spacing of 4 spaces. An iterable is any object that can be looped on such as list, tuple, string
Looping on both indexes and items
If we working with the index, then you can call the enumerate
function which returns a tuple of the index and the item
While Loops ?
While statement will execute a block of code as long as the condition is true
What are IF blocks ?
Last updated