"""
Simple program to demonstrate the use of a while loop to validate user input.

Author: Zachary Palmer
Date: 2015-09-22
"""

# Get the user input.  As long as it's invalid, keep asking for more.
preference = raw_input("Do you like circles or squares? ")
while preference not in ["circles","squares"]:
  print "That is not a valid input.  Please enter \"circles\" or \"squares\"."
  preference = raw_input("Which shape do you prefer? ")

# If the user asked for a circle, print one.
if preference == "circles":
  print "  ***  "
  print " *   * "
  print "*     *"
  print "*     *"
  print "*     *"
  print " *   * "
  print "  ***  "
else:
  # The only way to get here is to type in "squares".  The loop won't exit
  # unless "circles" or "squares" is entered and "circles" is captured by the
  # case above.
  print "*******"
  print "*     *"
  print "*     *"
  print "*     *"
  print "*     *"
  print "*     *"
  print "*******"

