CS 111 - 10/11/16 Start using iClickers in class. X points per question (thinking 5 points per question) (3 pts for answering the question 2 more points for answering it correctly) Last Time: Introduced if statement Relational Operators Greater than > Greater than or equal >= Less than < Less than or equal <= Equality == (beware not to confuse with assignment) Not equal != ( older version of Not equal is <> ) when using an if statement mot condtions use a relational operator There are multiple forms of the if statement The if-else form if : else : When the is true, the gets executed. When the is flase. the gets executed. # determine the larger of two values val1 = ??? val2 = ??? if ( val1 > val2 ) : max = val1 else: max = val2 print max What if we have more than 2 choices? def letterGrade(score): if score >= 90: letter = 'A' else: # grade must be B, C, D or F if score >= 80: letter = 'B' else: # grade must be C, D or F if score >= 70: letter = 'C' else: # grade must D or F if score >= 60: letter = 'D' else: letter = 'F' return letter def letterGrade(score): if score >= 90: letter = 'A' elif score >= 80: letter = 'B' elif score >= 70: letter = 'C' elif score >= 60: letter = 'D' else: letter = 'F' return letter Color distance: How "far apart" ar two colors when graphed on a 3 dimensional coordinate system using the - red axis (instead of the x axis) - green axis (instead of the y axis) - blue axis (instead of the z axis)