Study Guide for Quiz 2 (9 October 2009) There will be 30 short questions on this quiz. The quiz will cover material that we did after the first test. The questions will be of two types - either you will be asked to write a short line of code or you will be given code and asked what the output will be. * if-elif-else statement * for loops * built-in functions in Python abs(x) bin(x) bool(x) chr(i) eval (expression) float(x) hex(x) int(x) long(x) oct(x) ord(c) range(start, stop, incr) round(x) str() * functions and constants in the math library math.pi math.pow(x, y) math.sqrt(x) math.hypot(x, y) * functions in the random library random.randint() random.random() random.uniform(a, b) * string manipulations and functions in the string library string creation string indexing concatenation & repetition string slicing capitalize() center (width) count(sub) endswith(suffix) find(sub) isalnum() isalpha() isdigit() islower() isspace() isupper() join(seq) ljust(width) lower() lstrip() replace(old, new) rfind(sub) rstrip() split([sep]) startswith(prefix) strip() swapcase() upper() * string formating format-string % (val1, .., valn) % [flag][width][precision] type flag: 0, -, + type: d, f, c, s