1. a. 8 b. 7 c. Error d. 9 e. 9 f. [8, 16, 2, 7] g. [2, 7] 2. a. def mystery1(num1, num2): """Creates a list containing num2 repeated num1 times""" l = [] for i in range(num1): l.append(num2) return l b. def mystery2(num1, num2): """Creates a list containing num2 repeated num1 times""" return [num2]*num1 3. a. error, 5 isn't a sequence so we can't iterate over it in a for loop b. error, result is initialized as a string, so we can't add numbers to it c. 'aabbccdd' d. 'applesapplesbananasbananas' e. 'applesapplesbananasbananas' f. '112233' 4. def stupid_name(): name = input("Enter your name: ") # when checking, make sure you compare again lowercase versions if name.lower() == "dave" or name.lower() == "david": print(name + ", that's a great name!") else: print(name + ", that's a stupid name!") print("Nice to meet you, " + name) 5. def my_max(numbers): max = numbers[0] for num in numbers: if num > max: max = num return max They only difference here is what we initialize max to. In the version in class, since we knew they were positive, we could pick -1 since we knew that would be smaller than any of the numbers in the list. Here, we picked the first element in the list to get things started. If it's the max, then max will stay at that value. If it's not the max, then as we iterate through the list some other element will replace it eventually and we'll get the correct answer.