1(a) m = len(s)/2 s[:m]==s[m:] 1(b) One character in s[1:] is different from s[0], but the rest are the same as s[0] 1(c) 'axbxxc' 2 (a) s1 = 2+4 = 6 s2 = 1+3 = 4 so s2-s1 is -2 s1 = 2+4+...+ 98 s2 = 1+3+ + 97 + 99 so s2 - s1 is 99-49 = 50 (b) for k in rand(21): print 5*k (c) t is a string made up of those characters in s that appear only pnce 3(a) (s.count('N')==s.count('S')) and (s.count('E')== s.count('W')) (b) count=0 L = len(s) for k in range(L-4): if isCycle(s[k:k+4]): count +=1 return count 4(b) (2*3)/2 evaluates to 3 2*(3/2) evaluates to 2 (c) 1 10 0 10 1 12 2 10 22 1 12 0 (d) u is a local variable. A variable that a function may use to "do its thing" x and y are parameters. How the "input" is provided to the function. 5. # Draw a circle with radius r and center at (x,0) x = x + r + .75*r # The new x r = r*.75 # The new r 6. if n<=9; return '00' + str(s) elif n<=99: return '0' + str(n) else return str(n)