# Months.py Copyright (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-05-24 File created. # 2022-12-16 Converted to Python 3. # This program demonstrates how to use a list of strings. names_of_months = \ [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] print( "\n The first month of year is %s." % names_of_months[ 0 ], end="" ) print( "\n\n The seventh month, %s, is named after Julius Caesar." % \ names_of_months[ 6 ] ) print( "\n Our calendar has %d months." % len( names_of_months ) ) for month_index in range( 4 ) : number_of_letters_in_month_name = \ len( names_of_months[ month_index ] ) print( "\n %s is made of %d letters: " % \ ( names_of_months[ month_index ], number_of_letters_in_month_name ), end="" ) for letter_index in range( number_of_letters_in_month_name ) : print( names_of_months[ month_index ][ letter_index ], end=" " ) print( "\n" ) # The following list can be used in an exercise related # to Months.py: history_of_months = \ [ "month of Roman god Janus", # January "last month in Roman calendar", # February "month of Roman war god Mars", # March "month of Roman goddess Venus", # April "month of goddess Maia", # May "month of Roman goddess Juno", # June "month of Julius Caesar", # July "month of Emperor Augustus", # August "7th Roman month", # September "8th Roman month", # October "9th Roman month", # November "10th Roman month" ] # December