

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Number Sum
incomplete
2: Find Min
incomplete
3: Remove Non-Integers
incomplete
4: Factorial
incomplete
5: Area Sum
incomplete
6: List Division
incomplete
7: Join Strings
incomplete
8: Unit Tests
incomplete
9: Fix a Failing Test
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Remember, in Python you can divide two numbers using the / operator. For example:
print(6 / 2) # 3.0
print(8 / 4) # 2.0
You can also iterate over each item in a list using a for in loop. For example:
numbers: list[int] = [1, 7, 3, 2, 5]
for num in numbers:
print(num)
# 1
# 7
# 3
# 2
# 5
Complete the divide_list() function. It takes a list and a number as input, and should return a new list that contains all the elements of the original list after dividing them by the second input.
For example:
divided_list: list[float] = divide_list([6, 8, 10], 2)
print(divided_list)
# [3.0, 4.0, 5.0]
Do not round the resulting float numbers; just return them as they are.