Skip to content

Conversation

lauraporta
Copy link
Member

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Adds while loops, changes the order (now if else statements before the loops), adds break and continue statements, adds another exercise

How has this PR been tested?

Local build

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Comment on lines +478 to +495
## Question {.smaller}
* Write a loop that goes through the numbers 0 to 10
* For each number, print whether it is even or odd
+ Hint: use the modulus operator `%` and `==` to check for evenness

::: {.fragment .fade-in}
```{python}
#| echo: true
#| output-location: fragment
#| code-line-numbers: "|1|2,3|4,5|"
for i in range(11):
if i % 2 == 0:
print(f"{i} is Even")
else:
print(f"{i} is Odd")
```
:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to go after for loops I think

:::


## While loops {.smaller}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could while loops go after for loops?

lauraporta and others added 7 commits September 30, 2025 13:07
Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com>
Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com>
Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com>
Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com>
Co-authored-by: Igor Tatarnikov <61896994+IgorTatarnikov@users.noreply.github.com>
@lauraporta
Copy link
Member Author

I've applied the changes you suggested and added a slide on usage of and and or

@lauraporta lauraporta merged commit 7a09901 into main Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants