Food Access Sort Example

This example shows handling invalid input.

$ python3 sort_food_access.py
Please select one of the following choices:
1. Filter by state
2. Filter by population
3. Sort by state
4. Sort by population
5. Reset list
0. Quit

Enter selection: 6
Invalid choice, try again!
Enter selection: -3
Invalid choice, try again!
Enter selection: quit
Invalid choice, try again!
Enter selection: New York
Invalid choice, try again!
Enter selection: 2
min population? -1000

Invalid population size, try again.

min population? New York

Invalid population size, try again.

min population? 1
max population? CS21

Invalid population size, try again.

max population? 5

No records found

Please select one of the following choices:
1. Filter by state
2. Filter by population
3. Sort by state
4. Sort by population
5. Reset list
0. Quit

Enter selection: 1
State name? 3

No records found

Please select one of the following choices:
1. Filter by state
2. Filter by population
3. Sort by state
4. Sort by population
5. Reset list
0. Quit

Enter selection: 3

No records found

Please select one of the following choices:
1. Filter by state
2. Filter by population
3. Sort by state
4. Sort by population
5. Reset list
0. Quit

Enter selection: 4

No records found

Please select one of the following choices:
1. Filter by state
2. Filter by population
3. Sort by state
4. Sort by population
5. Reset list
0. Quit

Enter selection: 0

Goodbye!