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
Fantom [35]
3 years ago
14

Read_file = open('numbers.txt', 'r')

Computers and Technology
1 answer:
Svetradugi [14.3K]3 years ago
4 0

Answer:

To do that, use exception handling

Explanation:

Try:

    read_file = open('numbers.txt', 'r')

    file_numbers = read_file.read()

except  IOError exceptions:

    print("Trouble opening file. Try again")

    read_file.close()

list_values = file_numbers.split()

list_length = len(list_values)

for i in range(list_length):

list_values[i] = float(list_values[i])

except ValueError:

    print("File must have  only numbers. Try again.")

List_sum = sum(list_values)

Average_value = (List_sum)/list_length

print(Average_value)

You might be interested in
How can utility poles be eliminated as roadside hazards
ad-work [718]

The correct answer is D; All of the above.

Explanation:

There are numerous roadside hazards all over the world. Sadly, they cannot all be eliminated. However, there are steps to help reduce wrecks and fatalities by moving obstacles and placing barriers to help save lives.

Many places have started burying the lines underground and thus reducing the need the utility poles, but there are some places that this cannot be done. This will depend on the terrain and how rural the area is.

They have also started setting the poles back farther from the roadside. This helps reduce the number of crashes. If the poles are moved farther away, the drivers can correct themselves and keep going instead of hitting a pole and possibly losing their life.

There are now poles that are frangible. These poles will breakaway upon any type of impact. These are only used on the poles that are not carrying live wires.

Learn more about roadside hazards at brainly.com/question/12895441

#LearnwithBrainly

6 0
3 years ago
How do you know what memory to purchase for your computer?
Contact [7]
Just look for your computer model number and if not then it should be on the ram itself.
7 0
4 years ago
What would a programmer use to stop a while-looping sequence and return to the beginning of the statement?
Romashka-Z-Leto [24]

Answer:

Break

Explanation:

Break, in most languages exits the current loop when reached.

6 0
3 years ago
Read 2 more answers
You tried to access an external html page, which can not be opened on the device for preview. open the page in dreamweaver to pr
Snowcat [4.5K]
<span>You tried to access an external html page, which can not be opened on the device for preview. open the page in dreamweaver to preview the page on the device. </span><span>Real-Time Preview is a new feature in this version.  The developers didn't offer an option to turn it off in Preferences.  So, the best thing to do is to Right-Click on your document tab (or a file in your Files Panel) and select Open in Browser.  Then, choose your preferred browser. As a reminder, don't use F12.</span>
4 0
4 years ago
2 red and 2 overlapping balls in the center are surrounded by a green, fuzzy, circular cloud with a white line running through i
luda_lava [24]

Answer: Label A: nucleus. Label B: Electron Cloud

Explanation: I got it right

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which method of encryption is based on physics principles?
    5·1 answer
  • Why people needs soft skills in the era of high technology.
    13·1 answer
  • Which of the following is the java comparison operator for "not equal to"
    10·1 answer
  • What will the following loop display? 0 1 2 3 4 5 0 1 2 3 4 0 1 2 3 4 The loop will display numbers starting at 0, for infinity.
    8·1 answer
  • What is a secondary storage medium that uses magnetic techniques to store and retrieve data on disks or tapes coated with magnet
    6·1 answer
  • Which of the following is one of the tools in REPL.it that helps prevent syntax errors?
    10·1 answer
  • Divide 111001 by 1101​
    7·1 answer
  • Dgvdsgf cvdzgb fgvsdxchygfdrzvdszfgvsdzxd
    9·1 answer
  • ফাইল ও ফোল্ডারের মধ্যে পার্থক্য কি এবং ৫ টি ইনপুট ডিভাইসের নাম কি​
    7·2 answers
  • Which of the following is NOT a reason why supply chain infections areconsidered especially dangerous?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!