''' Purpose: practice mindful chrestomathics ------- Author: Email id: Assistance / checker: ''' # Global standard SECONDS_PER_MINUTE = 60 # we learned this in grade school # UVA standard NBR_MWF_CLASSES = 42 # the number of MWF meetings in a semester # CS1112 standard MINUTES_PER_CLASS = 75 # 2:00 - 3:15 = 75 minutes # look at the below assignment -- without context 60, 75, and 42 are # magic numbers. they work but requires thinking and looking throughout # the code for context seconds_of_1112 = 60 * 75 * 42 # the below assignment makes sense in isolation. a reader can check # above if they want to explicity know what are the values of the # operands seconds_of_1112 = SECONDS_PER_MINUTE * MINUTES_PER_CLASS * NBR_MWF_CLASSES # An advantage to naming magic numbers is that they only need to be entered # correctly once, so typos can be avoided. Python will automatically make # sure you when attempt to use the name, that it is sensible (i.e., already # defined) # A guideline across many programming languages is that the names for # magic values (i.e., constants) are upper snake_case print( 'CS 1112: from 0 to programmer in', seconds_of_1112, 'seconds.' )