Skip to content

Update README.md #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/iteration/for-loops/README.md
Expand Up @@ -9,7 +9,7 @@ Here are a few examples:

{{ code_from_file("iteration/for-loops/example-1.py", flavor = "python") }}

In this first case, we define a sting of text we poignantly called string. Then we create the 'for' loop by stating that for each index (i) inside the string, we want to print out the value of 'i'. It is common practice in coding to use 'i' as the variable that iterates through something in a loop or for an index location for something iterable. The output of this code is that each letter is looked at by the 'i' in the for loop and then printed out to a new line in the console.
In this first case, we define a string of text we poignantly called string. Then we create the 'for' loop by stating that for each index (i) inside the string, we want to print out the value of 'i'. It is common practice in coding to use 'i' as the variable that iterates through something in a loop or for an index location for something iterable. The output of this code is that each letter is looked at by the 'i' in the for loop and then printed out to a new line in the console.

{{ code_from_file("iteration/for-loops/example-2.py", flavor = "python", execute = True) }}

Expand Down Expand Up @@ -61,6 +61,7 @@ When the loop finishes, anything in the 'else' statement is executed. If the loo

{{ code_from_file("iteration/for-loops/example-6.py", 22, 39) }}


## Test Your Knowledge
### Countdown
See if you can create a loop that can count down from 10, and that once it gets to zero it prints the the word 'Liftoff!'. See if you can also make it print that the rocket was successfully launched.
Expand Down Expand Up @@ -92,4 +93,3 @@ Example output:
*****
******