COP4521 Homework 2 Name: FSU login: 1) (10 points). Let variable rate = 0.122. Write a print statement that prints the rate in both the raw value and the (round down) integer percentage format as the following using f-string: rate = 0.122 (12%) 2) (10 points). What is the output of the following code segment: a = [i * 2 for i in range(10)] print(a[:-2:3]) 3) (10 points). Write a function that takes two arguments, a dictionary dict and a keyword key, and returns True if key is in dict and False otherwise. 4) (20 points). Write a lambda function that has the same functionality as the following function. import math def isPowerOfTwo(x): if 2**math.log2(x) == x: return True else : return False 5) (20 points). Complete the body of the function to count the number of power of 2 numbers in a list using functional programming tools. The body should only contain one return statement. def countPowerOfTwo(lst): 6) (20 points). Write a class foo with three instance variables var1, var2, and var3. var1 should be initialized to 10 and var2 to 20 when an object of the class is created. var3 is initialized when method aaa in the class is invoked. 7) (10 points). Write a class boo that is a derived class of foo in problem 6) with an additional instance variable var that should be initialized to 100 when an object of class boo is created.