Study Guide for Test 1 (22 Feb 2017) * The test will be on Wednesday, 22 Feb 2017. The test will be held during scheduled class times. It will be closed book and closed notes. * You are responsible for the material in Liang's book from chapters 1 through 6. * Questions are of two types - write code or interpret code. * You will define variables, i.e. write meaningful variable names and their values. * You will evaluate expressions given certain input values. This will involve all the operators that were discussed in class not bitwise or shift. * You will write Boolean expressions that evaluate to True given a set of conditions. * You will create truth tables for Boolean expressions that will involve Boolean operators not, and, or, xor. The Boolean expressions will involve just two Boolean variables (let us say A and B) and your truth tables will have all possible permutations of A and B. * There will be questions on conditionals. You will either write conditional statements given a set of criteria or you will be given a conditional statements and a set of input values and you should be able to state what the result or output of those conditionals will be. * There will be questions on while and for loops. You should know the use of sentinel values and boolean flags. You also be familiar with break and continue within a loop. * You can be asked to draw patterns using nested loops. * You are responsible for these built-in functions: - abs (x) - bool (x) - chr (x) - eval (expr) - float (x) - format () - input (prompt) - int (x) - len () - list () - max () - min () - ord (x) - pow () - print () - range () - round (x, n) - str (x) - sum () - type (x) * From the Math library you are responsible for - ceil () - floor () - log (x, base) - pow () - sqrt () - hypot () - math.pi * From the Random Library you are responsible for - randint () - randrange () - random () - uniform () - choice () - shuffle () - sample () * You will write short functions or use functions that we have already written in class to solve problems. The user defined functions that we have developed in class are: - sum_digits (n) - rev_num (n) - is_palindromic (n) - is_prime (n) - sum_divisors (n) * You will have to write a full length program that will involve user input, computations involving operators and functions, conditionals, loops, and output. * Go through all the worked pieces of code in the book and then do the exercises at the end of each chapter. * Do the Logic-1 and Logic-2 problems from both the Python and Java sections in CodingBat.