8 - 10 Lessons Homework
- Vocabulary for this lesson
- Exercise 1
- Excercise 2
- QUIZ QUESTION REFLECTIONS
- 7 I answered mutation but mutation alters what the list has and it does not return what base 0 is therefore it was wrong
Vocabulary for this lesson
Elements - Item in a list. Pop- Take away something at the end of the list. Booleans- Recongnize true/false. Condition - Allows the computer to know whether or not to keep repeating the loop. Increment/Decrement - Modifies the counter variable after each repetition. Indexing/List Index - The position of an element in a list, starting from 0 Append/Remove/Pop : Various methods, append adds an element to the end, remove removes at an index, and pop removes the last item. Iteration- Way that code goes through a segment
list = [1, 2, 3, 4, 5] # Print this list in reverse orde
list.reverse()
print(list)
list = [9, 8, 4, 3, 5, 2, 6, 7, 1, 0]
print(f"Original {list}")
sl = insertion_sort(list)
print(f"Sorted {list}")