Scattergories Example 2

This example shows what error-checking should be done.


$ python scattergories.py

##############################
Scattegories v0.1
-----------------
Pick a letter and a category list.
You then have 30 seconds to write down an entry for each
category that starts with that letter. Good luck!
##############################


which letter? 4
that's not a letter...
which letter? pizza
that's not a letter...
which letter? c
which list? (1-6): 44
not in range...
which list? (1-6): pony
that's not a valid choice....
which list? (1-6): 2
**************************************************
                    1. Authors....... 
            2. Bodies of Water....... 
                      3. Birds....... 
                  4. Countries....... 
         5. Cartoon Characters....... 
                   6. Holidays....... 
     7. Things that are square....... 
                    8. Pokemon....... 
                   9. Clothing....... 
                10. Bad Habits....... 
                     11. Games....... 
              12. Sports Stars....... 
**************************************************
               category number? 99
not in range...
               category number? pony
that's not a valid choice....
               category number? 1
                    1. Authors: steinbeck
**************************************************
                    1. Authors.......steinbeck         # it's OK if user enters
            2. Bodies of Water.......                  # something that doesn't start
                      3. Birds.......                  # with the chosen letter
                  4. Countries....... 
         5. Cartoon Characters....... 
                   6. Holidays....... 
     7. Things that are square....... 
                    8. Pokemon....... 
                   9. Clothing....... 
                10. Bad Habits....... 
                     11. Games....... 
              12. Sports Stars....... 
**************************************************
               category number? 4
                  4. Countries: australia
**************************************************
                    1. Authors.......steinbeck
            2. Bodies of Water....... 
                      3. Birds....... 
                  4. Countries.......australia
         5. Cartoon Characters....... 
                   6. Holidays....... 
     7. Things that are square....... 
                    8. Pokemon....... 
                   9. Clothing....... 
                10. Bad Habits....... 
                     11. Games....... 
              12. Sports Stars....... 
**************************************************
               category number? 8
                    8. Pokemon: ponyta

       >>>>>>> TIME'S UP!!!!! <<<<<<<
        (that last one doesn't count) 

**************************************************


Here's your final card:
**************************************************
                    1. Authors.......steinbeck
            2. Bodies of Water....... 
                      3. Birds....... 
                  4. Countries.......australia
         5. Cartoon Characters....... 
                   6. Holidays....... 
     7. Things that are square....... 
                    8. Pokemon....... 
                   9. Clothing....... 
                10. Bad Habits....... 
                     11. Games....... 
              12. Sports Stars....... 
**************************************************



Return to Lab 07
Example 1
Example 3