Search Demographics Example

This example shows some error handling

python3 search_demographics.py
Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: P
Invalid selection, try again!
Enter selection: 5
Invalid selection, try again!
Enter selection: 55.5555
Invalid selection, try again!
Enter selection: Happy Pie Day
Invalid selection, try again!
Enter selection: 1
County name (or prefix)? Hogwarts

No records found

Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 2
State name (or prefix)? 3

No records found

Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 3
Minimum population? -29
Error: minimum population must be a positive integer; please try again!
Minimum population? twenty two
Error: minimum population must be a positive integer; please try again!
Minimum population? 99999999999999999999

No records found

Please select one of the following choices:
1. Search by county
2. Search by state
3. Search by population
0. Quit

Enter selection: 0

Goodbye!