An oceanic research vessel uses a coordinate grid system to map marine wildlife sightings. The grid layout is divided into 3 columns (X, Y, and Z) and 5 rows (1, 2, 3, 4, and 5) as shown in Figure 1.
| X | Y | Z | |
|---|---|---|---|
| 1 | |||
| 2 | [Sighting] | ||
| 3 | |||
| 4 | |||
| 5 |
valid = False
while valid == False:
sector = ""
while len(sector) != 2:
sector = input("Enter research sector ID (e.g. Y3): ")
sector = sector.upper()
Extend the Python program in Figure 2 so that it completes the validation checks to match the coordinate layout in Figure 1.
Your extended program must:
validsector is a valid column letter (X, Y, or Z)sector is a valid row number (1, 2, 3, 4, or 5)valid to True if both checks are metYou should write Python code or precise pseudocode in your answer.