COP4521 Homework 1 Name: FSU login: 1 (20 points). The content of file aa.py is as follows: -- print("aa.py Top level", __name__) def hello(): print("Hello from", __name__) -- The content of file bb.py is as follows: -- import aa print("bb.py Top level", __name__) aa.hello() -- What is the output when we run bb with 'python3 bb.py' on linprog? (10 points) Explain why each line is printed as it is (10 points) 2 (20 points). Consider the following code segment: def addObj(a, b): a.append(b) print('Inside 1: a = ', a) a = a + [b] print('Inside 2: a = ', a) lst = [1, 2, 3] addObj(lst, 100) print('Outside: lst = ', lst) What is the output when the code segment is executed? (10 points) Explain why each line is printed as it is (10 points) 3 (20 points). Let the content of foo.py be the following: ------------ count = 0 def incCount(): count = count + 1 incCount() print(count) ------------- What is the output when you run the code with 'python3 foo.py' on linprog (10 points)? Explain your answer (10 points) 4 (20 points). What is the output of the following code segment when executed (10 points)? Briefly explain (10 points). def aaa(x): def bbb(y): c = x * x return c * y return bbb area10 = aaa(10) print(area10(3)) print(area10(5)) 5 (20 points). Let a sequence of numbers be 5, 5, 3, 7, 1, 9, ... More precisely, the first three numbers are x_1= 5, x_2=5, and x_3 = 3. Following that x_i = x_{i-3} + x_{i-2} - x_{i-1}. For example, x_4 = x_1 + x_2 - x_3 = 5 + 5 - 3 = 7; x_5 = x_2 + x_3 - x_4 = 5 + 3 - 7 = 1; and so on. Write a generator for this sequence.