Class 6 Reflection


In Class 6, they taught us simple operations we can do to lists. We can add elements to a list, we can take away elements of a list, we can locate specific elements of a list (depending on the value assigned to the elements order), we can assign an element to an index, and much more. They also taught us another way to sort lists to find th minimum value using a very easy sort method. Later on, they even taught us how to perform binary and sequential searches. Binary searches require the lists to be organized in descending or ascending order. A sequential search does not require an order, and will search through the elements until it gets the desired target.

Homework 1:

bSearch = [3, 6, 12, 14, 50, 53]
middleIndex = (bSearch[0] + bSearch[5]) / 2
print(middleIndex)

fruits= ['Apple', 'Carrot', 'Mango', 'Peach']
A= [1, 3, 5, 8, 9]
B= [6, -1, 5, 12, 8]

#Type your choices below
#Definitley not fruits because that is a list of strings
#Not B either because it is not ordered from ascending or descending

answer = B



Homework 2:

yourlist = [8,10,35,39,49,52]
#type out your answers below and run the code and include output in screenshot

num1 = yourlist[1]
print(num1)

yourlist[2] = num1
print(yourlist[2])

#Adding the num1 
yourlist.append(num1)
print(yourlist[6])

print(yourlist)