Study Guide for CS 303E Test 2 (Fall 2012) on 31 Oct 2012 * Functions - user defined and built-in * Recursion * Math Functions * Strings and String Functions * Reading and Writing Text Files * Lists and List Functions * The questions will be similar to quiz questions and the tutorial exercises that you have done on Coding Bat and LiveLab. * Here are some additional String problems that you want to consider. In all cases you will be asked to write a function. - Write a function that accepts a String as input parameter and returns True if it is palindromic and False otherwise - Write a function that accepts two Strings as input parameters and returns True if they are anagrams and False otherwise - Write a function that accepts a String and a rotation parameter and rotates the String by that amount and returns it. For example, given a String "computer" and a rotation parameter of 2, it will return "ercomput". * Here are some file manipulation problems to look at. - Write a function that accepts two Strings - the name of an input file and a target String. It will return the number of occurences of the target String in the file. - Write a function that accepts the name of an input file and a list of forbidden words. If any one of those forbidden words exists in the file it will return False and True otherwise. * Here are some list problems for you look at: - Write a function that accepts a 1-D list as input parameter and returns a 1-D list that is a copy of the input list where each element of the input list is multiplied by the same factor. - Write a function that accepts a 1-D list of integers and returns True if all the numbers are in ascending order and False otherwise. (It will return True if all the elements are the same.) * These are problems from the book that I would like you to look at: - p. 263 - 266, Exercises: 8.1 - 8.13 - p. 349 - 351, Exercises: 10.1 - 10.13 * Coding Bat Problems on Recursion. These are from the file that was given to you called recursion1.py: - countX - changeXY - changePi - noX - array6 - array11 - array220 - allStar - pairStar - endX - countPairs - countAbc - count11 - stringClean - countHi2 - parenBit - nestParen - strCount - strCopies - strDist