Decision structures

In class exercises
Lab 03 and the word average program solution has been posted to update21. Run update21 at the command prompt to get these updates
$ update21
Creating /home/adas/cs21/solutions/w03-decisions
  Adding /home/adas/cs21/solutions/w03-decisions/wordAverage.py
Creating /home/adas/cs21/labs/03
Change into your inclass directory.
[~]$ cd
[~]$ cd cs21/inclass/
[inclass]$ ls
w01-intro/  w02-numAndString/  w03-decisions/
If the w03-decisions directory does not yet exist, create it using mkdir
[inclass]$ mkdir w03-decisions
Copy the sample files for today from my directory using cp
[inclass]$ cp ~adanner/public/cs21/w03-decisions/* w03-decisions/
[inclass]$ ls
w01-intro/  w02-numAndString/  w03-decisions/
[inclass]$ cd w03-decisions/
[w03-decisions]$ ls
birthyear.py  isAlpha.py  isOdd.py  speeding.py  wordavg.py
[w03-decisions]$
Never odd or even?
The first program we will look at is isOdd.py. Modify the program so that it prints out if a number entered by a user is odd or even. Think about how the mod or remainder operator % can be used with an if statement to solve this problem. Some sample runs are shown below.
$ python isOdd.py 
Please enter a number: 0
0 is even

$ python isOdd.py 
Please enter a number: 1243678
1243678 is even

$ python isOdd.py 
Please enter a number: 2371
2371 is odd
What did you type?
Next open isAlpha.py and modify the program so that it determines if a single character (a length 1 string) entered by the user is an uppercase letter, a lowercase letter, a decimal digit, or none of the above (usually punctuation). This program relies on python's ability to compare two strings using the operators < >, ==, <=, >=, and !=. Try it! Comparisons are done using the ASCII character codes. If you want to quickly see what happens, try a few example in a separate python shell. Some example runs of a sample program are shown below.
$ python isAlpha.py 
Enter a single keyboard character: 3
'3' is a decimal digit

$ python isAlpha.py 
Enter a single keyboard character: a
'a' is a lowercase letter

$ python isAlpha.py 
Enter a single keyboard character: Q
'Q' is an uppercase letter
What if the user enters more than one character? Can you inform them politely on how to run the program correctly?