Figure 1 shows a grid representing a 3x3 shelf indexing system in a library archives section.
Figure 1
| X | Y | Z | |
|---|---|---|---|
| 4 | |||
| 5 | |||
| 6 | Book |
Figure 2 shows an incomplete Python program designed to validate the user's shelf code input.
Figure 2
isValid = False
while isValid == False:
code = ""
while len(code) != 2:
code = input("Enter shelf code (e.g. Y5): ")
code = code.upper()
Extend the program from Figure 2 so it completes the other checks needed to make sure a valid shelf code is entered.
The shelf code is valid if:
Your extended program must:
isValidYou should use indentation as appropriate, meaningful variable names, and correct Python syntax in your answer.