Unit 3 Sections 8-10 Hacks
Hacks
list = [1,2,3,4,5]
list.reverse()
print(list)
newlist = list.reverse()
print(newlist)
list = [9,8,4,3,5,2,6,7,1,0]
def bubbleSort(list):
n = len(list)
for i in range(n):
for j in range (0, len(list) - i - 1):
if list[j] > list[j+1]:
value = list[j]
list[j] = list[j+1]
list[j+1] = value
bubbleSort(list)
print(list)