You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a function called `merge_two_list` that expects an list of numbers (integers).
5
+
1. Create a function called `sort_odd_even` that expects a list of numbers (integers).
6
6
7
-
2. Loop through the list and separate the `odd` and the `even` numbers in different lists.
7
+
2. Loop through the list and separate the *odd* and the *even* numbers.
8
8
9
-
3.If the number is odd number push it to a placeholder list named `odd`.
9
+
3.Create a variable called `sorted_list`to start appending the *odd* numbers.
10
10
11
-
4. If the number is even number push it to a placeholder list named `even`.
11
+
4. If the number is even, push it to a placeholder list named `even`.
12
12
13
-
5. Then concatenate the `odd` list to the even list to combine them. Remember, the `odd` list comes first and you have to append the even`mergeTwoList`.
13
+
5. Then insert the `even` list into the `sorted_list`. Remember, the *odd* numbers come first, and you have to insert the `even` list after.
14
14
15
-
## 💡 Hint:
15
+
## 💡 Hints:
16
16
17
17
+ Create empty (placeholder) variables when you need to store data.
18
18
19
-
## Expected result:
19
+
+ Check out the `extend()` method: https://www.w3schools.com/python/ref_list_extend.asp
20
+
21
+
## 💻 Expected result:
22
+
23
+
Everything should be inside a single list; there should not be nested lists.
0 commit comments