Name_______________________________ Your final answer to each question should appear on this sheet.
v22.0002, Additional sample questions for the final
None of the functions you write should read from the keyboard. Don't call input()

1 Given the following method heading
def palindrome( s):
write a method that returns True if the string s is a palindrome, i.e., the letters are symmetric around the midpoint of the string. It should return False, if the string is not a palindrome. For example, "asdffdsa" and "asdfdsa" are palindromes where as "asdfgh" is not.

2. Write a function with the heading def palindrome(x) that determines if the list x is a palindrome.

3.. Given a list x that has at least m elements and a list y that has at least n elements, write a function with the heading def addThem(x, y, m, n) that returns an array that has as its first m elements the first m elements of x and as its next n elements the first n elements of y.

4. Write a function with the heading def pattern(n): that produces the following triangle:

where the bottom line has n x's.

5. Write a function def sum(x): that adds and returns the sum of all the elements in the list x.