D. Do the online reading: <a href="http://www.rose-hulman.edu/class/csse/csse120/VideoFiles/11.1-OverloadingThePlusSymbol/Handouts/OverloadingThePlusSymbol.pdf" target=newtab><b>Overloading the plus operator</b></a>, doing the next set of questions while you do so. 1. <code>11 + 22</code> evaluates to: (HINT: enter <em>error</em> if it generates an error) ANS. 33 2. <code>'11' + '22'</code> evaluates to: (HINT: enter <em>error</em> if it generates an error) ANS. '1122' ANS. 1122 ANS. "1122" 3. <code>'11' + str(3 + 3) + '22'</code> evaluates to: (HINT: enter <em>error</em> if it generates an error) ANS. '11622' ANS. "11622" ANS. 11622 4. <code>'11' + 33</code> evaluates to: (HINT: enter <em>error</em> if it generates an error) ANS. error ANS. ERROR 5. What does the following code snippet print: <pre> x = 1 <br> y = 2 <br> z = 3 <br> print(x, y, z)</pre> a. <code>1, 2, 3</code> b. <code>1 2 3</code>~ c. <code>6</code> d. <code>123</code> 6. What does the following code snippet print: <pre> x = 1 <br> y = 2 <br> z = 3 <br> print(str(x) + str(y) + str(z))</pre> a. <code>1, 2, 3</code> b. <code>1 2 3</code> c. <code>6</code> d. <code>123</code>~ 7. What does the following code snippet print: <pre> x = 1 <br> y = 2 <br> z = 3 <br> print(x + y + z)</pre> a. <code>1, 2, 3</code> b. <code>1 2 3</code> c. <code>6</code>~ d. <code>123</code> 8. What does the following code snippet print: <pre> x = 1 <br> y = 2 <br> z = 3 <br> print(str(x + y) + str(z))</pre> ANS. 33 9. Implement a function named <em>print_equation</em> that given two numbers <em>x</em> and <em>y</em> prints an equation for the sum of them. For example, if <code>x</code> is <code>65</code> and <code>y</code> is <code>11</code>, the function would print <code>65+11=76</code>. M. Line 1 -> def print_equation(x, y): M. Line 2 -> print(str(x) + "+" + str(y) + "=" + str(x+y)) M. -> print(x, y, x+y) M. -> print(x+++y+ = +x+y) M. -> print("65+11=76") D. Do the online reading: <a href="http://www.rose-hulman.edu/class/csse/csse120/VideoFiles/11.2-AccumulatingSequences/Handouts/AccumulatingSequences.pdf" target=newtab><b>Accumulating Sequences</b></a>, doing the next set of questions while you do so. D. On a piece of paper (NOT here in Moodle), implement the following function, per its doc-string. You do NOT have to be completely correct, just try to get the main idea correct, with guidance from the reading. After you have made a reasonable try, turn to the next page in this Moodle quiz for a solution. <pre>def make_simple_list(m, n):<br> """<br> Returns the list [m, m+1, m+2, ... n],<br> where m and n are the given arguments.<br> For example, if m is 5 and n is 13,<br> then this function returns:<br> [5, 6, 7, 8, 9, 10, 11, 12, 13]<br> """</pre> D. Here is a solution to the previous problem. Compare your solution to it. Bring any questions about this problem to class.<pre>def make_simple_list(m, n):<br> """<br> Returns the list [m, m+1, m+2, ... n],<br> where m and n are the given arguments.<br> For example, if m is 5 and n is 13,<br> then this function returns:<br> [5, 6, 7, 8, 9, 10, 11, 12, 13]<br> """<br> seq = []<br> for k in range(m, n + 1):<br> seq = seq + [k]<br> return seq<br></pre> 1. Consider the following code. What should the missing statement be (that is, the statement marked ???).<pre>def make_list(n):<br> """<br> Returns the list [1, 2, 3, ... n],<br> where n is the given argument.<br> For example, if n is 5,<br> then this function returns:<br> [1, 2, 3, 4, 5]<br> """<br> seq = []<br> for k in range(n):<br> ???<br> return seq<br></pre> a. <code> seq = seq[k+1]</code> b. <code> seq = seq + k + 1</code> c. <code> seq = seq[k] + [k]</code> d. <code> seq[k] = seq[k] + [k]</code> e. <code> seq = seq + [k + 1]</code>~ e. <code> seq = seq + [k]</code> D. Watch the video: <a href="http://www.rose-hulman.edu/class/csse/csse120/VideoFiles/11.3-PatternsForIteratingThroughSequences/Video/PatternsForIteratingThroughSequences/PatternsForIteratingThroughSequences.mp4" target=newtab><b>Sequences</b></a>, doing the next set of questions while you do so. D. For the next set of questions, consider the following three function definitions:<pre>def foo1(seq):<br> total = 0<br> for k in range(len(seq) // 2):<br> total = total + seq[1 + (2 * k)]<br> return total<br><br><br>def foo2(seq):<br> total = 0<br> for k in range(1, len(seq), 2):<br> total = total + seq[k]<br> return total<br><br><br>def foo3(seq):<br> total = 0<br> m = 1<br> for _ in range(len(seq) // 2):<br> total = total + seq[m]<br> m = m + 2<br> return total<br></pre> 1. To what number does <code>foo1([3])</code> evaluate? a. 0~ b. 1 c. 2 d. 3 e. 4 f. 5 g. 6 h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15 q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo1([3, 6])</code> evaluate? a. 0 b. 1 c. 2 d. 3 e. 4 f. 5 g. 6~ h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15 q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo1([3, 6, 1, 4, 9, 5])</code> evaluate? a. 0 b. 1 c. 2 d. 3 e. 4 f. 5 g. 6 h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15~ q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo2([3])</code> evaluate? a. 0~ b. 1 c. 2 d. 3 e. 4 f. 5 g. 6 h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15 q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo2([3, 6])</code> evaluate? a. 0 b. 1 c. 2 d. 3 e. 4 f. 5 g. 6~ h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15 q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo2([3, 6, 1, 4, 9, 5])</code> evaluate? a. 0 b. 1 c. 2 d. 3 e. 4 f. 5 g. 6 h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15~ q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo3([3])</code> evaluate? a. 0~ b. 1 c. 2 d. 3 e. 4 f. 5 g. 6 h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15 q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo3([3, 6])</code> evaluate? a. 0 b. 1 c. 2 d. 3 e. 4 f. 5 g. 6~ h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15 q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 1. To what number does <code>foo3([3, 6, 1, 4, 9, 5])</code> evaluate? a. 0 b. 1 c. 2 d. 3 e. 4 f. 5 g. 6 h. 7 i. 8 j. 9 k. 10 l. 11 m. 12 n. 13 o. 14 p. 15~ q. 16 r. 17 r. 18 r. 19 r. 20 r. 24 r. 33 r. 38 D. For the next set of questions, consider the following two attempts at a function that returns the first negative item in the sequence of numbers, or <code>None</code> if the sequence contains no negative numbers. One is correct and the other is wrong. <pre>def find1(numbers):<br> for k in range(len(numbers)):<br> if numbers[k] < 0:<br> return numbers[k]<br> else:<br> return None<br><br><br>def find2(numbers):<br> for k in range(len(numbers)):<br> if numbers[k] < 0:<br> return numbers[k]<br> return None<br><br><br></pre> 1. To what number does <code>find1([-3, 6, 1, 4, 9, 5])</code> evaluate? ANS. -3 1. To what number does <code>find2([-3, 6, 1, 4, 9, 5])</code> evaluate? ANS. -3 1. To what number does <code>find1([3, 6, 1, 4, 9, 5])</code> evaluate? ANS. None 1. To what number does <code>find2([3, 6, 1, 4, 9, 5])</code> evaluate? ANS. None 1. To what number does <code>find1([3, -6, 1, 4, 9, 5])</code> evaluate? ANS. None 1. To what number does <code>find2([3, -6, 1, 4, 9, 5])</code> evaluate? ANS. -6 1. Which attempt is correct? a. <code>find1</code> b. <code>find2</code>~