Lecture Notes on 5 Feb 2014 Let us recapitulate what we did in previous lectures. * We see the world in binary * Number conversions - binary, octal, and hexadecimal * Structure of Python * Arithmetic Operators * Algorithms New Topics in this lecture * Problem Decomposition - Analysis Ask what is given and what you should output - Design Create the algorithm to solve the problem - Implementation Code the algorithm in Python - Testing Constantly test as you write. Use print statements liberally. * Develop Iteratively - Add a few lines of code and test - Always test as you write code * Outline of Easter Sunday def main(): # prompt the user to enter the year y = int (input ('Enter year: ')) print (y) # determine a a = y % 19 print (a) ... # Write out the result if (n == 3): print ('In', y, 'Easter Sunday is on', p, 'March') main() * Expressions and Statements * Comparison operators: < <= > >= == != * Understand the difference between the following two pieces of code x = 1 # statement x == 1 # expression