Problem 1 Part A a = 35/9, int, 3 b = "concatentate"[3:6] string, "cat" c = "one two three".split(), list, ["one", "two", "three"] d = 32 < 6, boolean, False e = sum(range(0,5)), int, = sum([0,1,2,3,4]) = 10 f = 4.0*2.5, float, 10.0 g = "apple"+"pie", string, "applepie" h = 37%6, int, 1 i = "tortoise"[2], string, "r" j = 4**3, int, 64 k = [2,3,5,7,11,13,15][2:4], list, [5,7] Part B: b = a does not make a copy of a, but makes b a 'label' for the list referenced by a. So a and b both reference the same list. Thus assignment to b[0] is the same as assignment to a[0] Part C: len(w) Problem 2: def cone_volume(r,h): return math.pi*r*r*h/3.0 def big_words(words): return [w for w in words if len(w) > 8] def big_words(words): lst = [] for w in words: if len(w) > 8: lst.append(w) return lst def is_abundant(num): return sum(divisors(num)) > num def abundant_count(low,high): c = 0 for num in range(low,high+1): if is_abundant(num): c += 1 return c def abundant_count(low,high): return len([i for i in range(low,high+1) if is_abundant(i)]) Problem 3: Part A The function random.randint(a,b) includes endpoints a and b, so using len(stipe_funcs) could return the length of the list as a random number, but the length of the list is NOT A VALID INDEX since valid indexes start at 0 and go up to but do NOT INCLUDE the length of the list It happens sometimes because it's at random, e.g., for a 10 element list it should happen one in ten times. Part B: Add stripe_star to the list of functions stripe_funcs (in addition to putting the code for strip_star in Designs.py) Part C: The easiest change is to modify design: s = random_stripe() + " " + random_stripe() Part D: The easiest change it to modify random_stripe() a = "|" + func()*2 + "|" or a = "|" + func()+func() + "|" Problem 4: def find_mode(nums): occs = [nums.count(n) for n in nums] mx = max(occs) for n in nums: if nums.count(n) == mx: return n OR def find_mode(nums): occs = [nums.count(n) for n in nums] mx = max(occs) index = occs.index(mx) return nums[index]