1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tensa zangetsu [6.8K]
3 years ago
15

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.
Computers and Technology
1 answer:
mixas84 [53]3 years ago
3 0

Answer:

Check the explanation

Explanation:

# Step 1

the first thing to execute will be......

f = open("states.txt")

# Step 2

the second step is......

states = []

for line in f:

   states.append(line.strip())

# Step 3:

the third step is to......

for state in sorted(states):

   print(state)

f.close()

You might be interested in
Which view is most often used to reorder slides in a presentation that has already been created?
riadik2000 [5.3K]

Answer:

Normal view

Explanation:

The normal view is best used because it is just to drag and drop

4 0
2 years ago
Read 2 more answers
A resistor bank is connected to a controller with conductor insulation rated 75 °C. The resistors are not used in conjunction wi
irina [24]

Explanation:

This means that it requires a disconnecting means for each motor, and it must be located in sight from the motor location and the driven machinery location.

Multiply the FLC of the largest motor by 125%.

Add up the FLCs of the other motors.

Multiply the continuous non-motor loads by 125%.

Add up all of the above to the total of the non-continuous loads.

3 0
3 years ago
What is an example of a device that commonly use Linux today
slava [35]

Answer:

include iPods, PlayStations, Xbox, TiVo, and WRT54G.

Explanation:

3 0
2 years ago
Read 2 more answers
Write a police description a person who know you well​
SIZIF [17.4K]

Answer:

I will be describing Jude. He is a neighbor.

Explanation:

A police description refers to the method of describing a person using high-level detailing. An example is given below:

  1. He is a Five feet-three male caucasian
  2. With brown eyes and
  3. an Australian accent
  4. He has a military haircut
  5. About 38 years
  6. Weighs about 95Kg
  7. and dresses casually
  8. he walks with a slant to the left
  9. a dove tattoed at the back of his neck
  10. and a birthmark on his left ear lobe

Cheers

3 0
3 years ago
Can someone help: how to get binary?
xxTIMURxx [149]

Answer:

Explanation:

SENN KİMSİİİİİİİİN???

8 0
1 year ago
Read 2 more answers
Other questions:
  • A(n) _____ is a fake online persona created to promote a particular point of view, often in praise of a firm, product, or indivi
    15·1 answer
  • A set of communication rules for the computer to follow is called, what?
    10·2 answers
  • What computer system was the first to run the unix operating system?
    11·1 answer
  • A senior center would like to add a new computer to their library so that members can check their email and read book reviews
    11·2 answers
  • With the ease of the Internet, it is not uncommon for individuals to copy skills from resume templates to make themselves look m
    9·1 answer
  • Write a program that asks the user to enter two integer numbers X and Y. The program halves each number between X and Y then pri
    15·1 answer
  • Which of these is a valid use of the Reply All feature?
    11·1 answer
  • Help me decide this hurry
    12·1 answer
  • Please help! I tried this by myself. But I am not sure if this is right.
    8·2 answers
  • In order to personalize your desktop, you may click on: Start>settings>Personalization . . .
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!