|
8 | 8 |
|
9 | 9 | 3. Create a variable called `sorted_numbers` to start appending the *odd* numbers.
|
10 | 10 |
|
11 | | -4. Then insert the *even* numbers into the `sorted_numbers`. Remember, the *odd* numbers come first, and you have to insert the *even* numbers after. |
| 11 | +4. If the number is even, push it to a placeholder list named `even`. |
| 12 | + |
| 13 | +5. Then insert the `even` list into the `sorted_numbers`. Remember, the *odd* numbers come first, and you have to insert the `even` list after. |
12 | 14 |
|
13 | 15 | ## 💡 Hints:
|
14 | 16 |
|
|
18 | 20 |
|
19 | 21 | ## 💻 Expected result:
|
20 | 22 |
|
| 23 | +Everything should be inside a single list; there should not be nested lists. |
| 24 | + |
21 | 25 | ```py
|
22 | 26 | sort_odd_even([1, 2, 33, 10, 20, 4])
|
23 | 27 |
|
24 | | -[[1, 33, 2, 10, 20, 4]] |
| 28 | +[1, 33, 2, 10, 20, 4] # <-- Yes |
| 29 | +[[1,33], [2,10,20,4]] # <-- No |
25 | 30 | ```
|
0 commit comments