ME 3350 -Engineering Computing HW 4 Submission: Submit your final Python code(s) on CANVAS. 1. The text file “HW4_StatesANC.txt" contains the name, abbreviation, nickname, and capital of each state in the United States in alphabetical order. Write a program that displays the states (and their capitals) for which the name of the state and its capital begin with the same letter. Instruction: Use for loop to access the lines of the text file. Your program output should look as follows: Dover, Delaware Honolulu, Hawaii Indianapolis, Indiana Oklahoma City, Oklahoma >>> 2. The text file "HW4_StatesANC.txt" contains the name, abbreviation, nickname, and capital of each state in the United States in alphabetical order. Write a program that requests the name of a state as input and displays the abbreviation, nickname, and capital of the state. Example Input and Output: Enter the name of a state: Utah Abbreviation: UT Nickname: Beehive State Capital: Salt Lake City >>>
Hi this a txt.file below please write a python code that uses same instruction with the picture file below
Alabama,AL,Cotton State,Montgomery
Alaska,AK,The Last Frontier,Juneau
Arizona,AR,Grand Canyon State,Phoenix
Arkansas,AK,Land of Opportunity,Little Rock
California,CA,Golden State,Sacramento
Colorado,CO,Centennial State,Denver
Connecticut,CT,Constitution State,Hartford
Delaware,DE,Diamond State,Dover
Florida,FL,Sunshine State,Tallahassee
Georgia,GA,Peach State,Atlanta
Hawaii,HI,Aloha State,Honolulu
Idaho,ID,Gem State,Boise
Illinois,IL,Prairie State,Springfield
Indiana,IN,Hoosier State,Indianapolis
Iowa,IA,Hawkeye State,Des Moines
Kansas,KS,Sunflower State,Topeka
Kentucky,KY,Bluegrass State,Frankfort
Louisiana,LA,Pelican State,Baton Rouge
Maine,ME,Pine Tree State,Augusta
Maryland,MD,Old Line State,Annapolis
Massachusetts,MA,Bay State,Boston
Michigan,MI,Wolverine State,Lansing
Minnesota,MN,Gopher State,Saint Paul
Mississippi,MI,Magnolia State,Jackson
Missouri,MS,Show Me State,Jefferson City
Montana,MT,Treasure State,Helena
Nebraska,NE,Cornhusker State,Lincoln
Nevada,NV,Silver State,Carson City
New Hampshire,NH,Granite State,Concord
New Jersey,NJ,Garden State,Trenton
New Mexico,NM,Land of Enchantment,Santa Fe
New York,NY,Empire State,Albany
North Carolina,NC,Tar Heel State,Raleigh
North Dakota,ND,Flickertail State,Bismark
Ohio,OH,Buckeye State,Columbus
Oklahoma,OK,Sooner State,Oklahoma City
Oregon,OR,Beaver State,Salem
Pennsylvania,PA,Keystone State,Harrisburg
Rhode Island,RI,Little Rhody,Providence
South Carolina,SC,Palmetto State,Columbia
South Dakota,SD,Coyote State,Pierre
Tennessee,TN,Volunteer State,Nashville
Texas,TX,Lone Star State,Austin
Utah,UT,Beehive State,Salt Lake City
Vermont,VT,Green Mountain State,Montpelier
Virginia,VA,Old Dominion,Richmond
Washington,WA,Evergreen State,Olympia
West Virginia,WV,Mountain State,Charleston
Wisconsin,WI,Badger State,Madison
Wyoming,WY,Equality State,Cheyenne
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images