Lecture Notes on 27 Sep 2013 * Test 1 on 2 Oct 2013 - in class and closed book No multiple choice questions Number conversions Write code or interpret code Study guide posted * Assignment 3 due today * Code Lab Tutorial exercises for Chapter 4 posted Due on Monday, 30 Sep 2013 * Assignment 4 posted due on 1 Oct 2013 * Outline of the program to compute the day of the week def main(): # Prompt the user to enter the year year = int (input ('Enter year: ')) print (year) # Prompt the user to enter the month month = int (input ('Enter month: ')) print (month) # Prompt the user to enter day day = int (input ('Enter day: ')) print (day) # Compute parameters a, b, c, and d ... # Compute day of the week using Zeller's algorithm ... # Write out the result using chained conditionals if (r == 0): print ('The day is Sunday.') elif (r == 1): print ('The day is Monday.') ... main() Boolean Expressions Assume num is an integer variable and ch is a string of one character. Write a boolean expression that evaluates to True if num is even. (num % 2 == 0) Write a boolean expression that evaluates to True if num is odd. (num % 2 == 1) (num % 2 != 0) Write a boolean expression that evaluates to True if num is a factor of 12. (12 % num == 0) Write a boolean expression that evaluates to True if num is a multiple of 12. (num % 12 == 0) Write a boolean expression that evaluates to True if num is a two digit number. (num >= 10) and (num <= 99) Assume the variable year is a valid year. Write a boolean expression that evaluates to True if year is a leap year. (year % 400 == 0) or ((year % 100 != 0) and (year % 4 == 0)) Write a boolean expression that evaluates to True if ch is a lower case character. (ch >= 'a') and (ch <= 'z') Write a boolean expression that evaluates to True if ch is a letter. ((ch >= 'a') and (ch <= 'z')) or ((ch >= 'A') and (ch <= 'Z'))