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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started