

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Lists
incomplete
2: Lists Continued
incomplete
3: Counting in Programming
incomplete
4: Indexing Into Lists
incomplete
5: List Length
incomplete
6: List Updates
incomplete
7: Appending in Python
incomplete
8: Pop Values
incomplete
9: Counting the Items in a List
incomplete
10: No-Index Syntax
incomplete
11: Find an Item in a List
incomplete
12: Find the Increase
incomplete
13: Find Max
incomplete
14: Modulo Operator in Python
incomplete
15: Slicing Lists
incomplete
16: List Operations – Concatenate
incomplete
17: List Operations – Contains
incomplete
18: List Deletion
incomplete
19: Tuples
incomplete
20: First Element
incomplete
21: Reverse List
incomplete
22: Filter Messages
incomplete
23: Even Teams
incomplete
24: Alchemy Ingredients
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Click to play video
The modulo operator can be used to find the remainder after a division operation. For example, 7 modulo 2 would be 1, because 2 can be multiplied evenly into 7 at most 3 times:
2 * 3 = 6
Then there is 1 remaining to get from 6 to 7.
7 - 6 = 1
The modulo operator is the percent sign: %. It's important to recognize modulo is not a percentage though! That's just the symbol we're using.
remainder = 8 % 3
# remainder = 2
An odd number is a number that when divided by 2, the remainder is not 0.
Inside the loop in the get_odd_numbers function, use the modulo operator to check if each number, i, is odd. If a number is odd, append it to the odd_numbers list. The function already returns the odd_numbers list for you. num is an integer.