#A. Write a function that takes one string as a parameter, and # - returns True if the string contains any sequence like 'a*k' in it, # where * can be any character, and False otherwise #You can assume the input string is in lower case # E.g., # barkingmad returns True # basking mad returns True # borking mad returns False def pattern(s): for i in range(len(s)-2): if s[i]=='a'and s[i+2]=='k': return True return False print pattern('barkingmad') print pattern('boardking') print 'to do' #B. Write a function that takes a positive integer n and #returns the sum of all even integers from 2 through n #(possibly inclusive of n, if n is even). def sumofevens(n): mysum = 0 for i in range(n+1): if i % 2 == 0: mysum += i return mysum print 'to do'