Question: Write a program that uses string Indexing to generate the two character abbreviation for all fifty states. Your program should provide clear instructions to give
Write a program that uses string Indexing to generate the two character abbreviation for all fifty states. Your program should provide clear instructions to give the User an option to either key in a state of their choice to return the correct abbreviation or to print a complete list of all state names followed by their correct abbreviation (see below). Note that although all state abbreviations begin with the first letter of their respective state name, the second later varies. Experiment using both positive and negative index values in your program. Use the anyVariable.upper() method to capitalize your abbreviations (USE PYTHON CODE)
| Alabama - AL | Hawaii - HI | Massachusetts - MA | New Mexico - NM | South Dakota - SD |
| Alaska - AK | Idaho - ID | Michigan - MI | New York - NY | Tennessee - TN |
| Arizona - AZ | Illinois - IL | Minnesota - MN | North Carolina - NC | Texas - TX |
| Arkansas - AR | Indiana - IN | Mississippi - MS | North Dakota - ND | Utah - UT |
| California - CA | Iowa - IA | Missouri - MO | Ohio - OH | Vermont - VT |
| Colorado - CO | Kansas - KS | Montana - MT | Oklahoma - OK | Virginia - VA |
| Connecticut - CT | Kentucky - KY | Nebraska - NE | Oregon - OR | Washington - WA |
| Delaware - DE | Louisiana - LA | Nevada - NV | Pennsylvania - PA | West Virginia - WV |
| Florida - FL | Maine - ME | New Hampshire - NH | Rhode Island - RI | Wisconsin - WI |
| Georgia - GA | Maryland - MD | New Jersey - NJ | South Carolina - SC | Wyoming - WY |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
