subject

G Create a program that reads a list of states from an input file, puts them in order, and displays the sorted list to the user. Description Read in a list of states from a file, and output those states in alphabetical order. Provided input files A single input file named states. txt is provided that lists states of the United States - one state per row. Some states have lowercase letters, where some begin with uppercase letters. As a reminder, lowercase letters come after uppercase letters alphabetically. The states are in a random order. The file has the following format: Michigan california New Mexico Texas nevada ... Objectives Write the following in main. py: Open the states. txt file. Create a list called ‘states’ where each element in the list is one of the states read from the file. Do not change the text that is read from the file. Print to the user (not to a file) an alphabetized list of all the states, with one state per line. For example, Alabama Alaska Arizona ... Note: You will lose points if you do not correctly work with the file. If you decide to just use a print statement to display the output, without using file input, and pass the test case with 100%, you will eventually lose points. This program will be checked after the deadline. In short, do not try to cheat the system by simply displaying the list of states.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
question
Computers and Technology, 23.06.2019 12:40
Curriculum exam to process a resident's payment, you must click on onesite payments home page. from the a. reports b. my settings o c.transactions o d. rent tab
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
To move a file or folder in microsoft windows, you can click and hold down the left mouse button while moving your mouse pointer to the location you want the file or folder to be, which is also known as.
Answers: 3
You know the right answer?
G Create a program that reads a list of states from an input file, puts them in order, and displays...
Questions
question
Mathematics, 12.04.2021 01:10
Questions on the website: 13722360