# Homework ack #1
print('Oh no! We need to replace Nathan\'s third period class')
list = ['CSP', "Humanities", 'Calc', 'History']
first_section = list[:2]
last_section = list[-2:]
print(str(first_section) + ", ..., " + str(last_section))
user_input = input("What should replace it?")
list.insert(2, user_input)
print(list)
Oh no! We need to replace Nathan's third period class
['CSP', 'Humanities'], ..., ['Calc', 'History']
['CSP', 'Humanities', 'Spanish', 'Calc', 'History']
# Homework hack #2
def fibonacci(x):
if x==1:
return(0) # First terminating statement (Needed to state the first number of the fibonacci sequence)
if x == 2:
return(1) # Second terminating statement (Since 0+0=0, we need to introduce integers to the sequence)
else:
return(fibonacci(x-1)+ fibonacci(x-2))
for i in range(8):
print(fibonacci(i+1))