Read_file = open('numbers. txt', 'r')
file_numbers = read_file. read()
read_file. clos...
Computers and Technology, 18.04.2020 02:44 Aspect148
Read_file = open('numbers. txt', 'r')
file_numbers = read_file. read()
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])
List_sum = sum(list_values)
Average_value = (List_sum)/list_length
print(Average_value)
Problem:
Modify the program you wrote for Chapter 6 Exercise 6 so it handles the following
exceptions:
• It should handle IOError exceptions that are raised when the file is opened
and data is read from it by printing "Trouble opening file. Try again." and
not executing any more of the code.
• It should handle any ValueError exceptions that are raised when the items
that are read from the file are converted to a number by printing "File must have
only numbers. Try again." and not executing any more of the code.
Answers: 3
Computers and Technology, 21.06.2019 23:30
Acomputer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a series of stored . the processing unit of most modern computers is a(n) . the instructions that tell a computer how to carry out a task are referred to as computer , which are distributed as software. computers run three main types of software: software, system software, and development tools. an example of system software is a computer system, which is essentially the master controller for all the activities that a digital device performs. digital devices are constructed using tiny electronic components that represent data bits as electrical signals. the system unit houses the system board, which contains several circuits made from semiconducting materials. computers come in three popular form factors: component, , and slate. many of today's digital devices operate on battery power supplied by ion batteries. battery life and lifespan can be extended by following good battery management practices.
Answers: 3
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
Advanced Placement (AP), 05.02.2020 07:58
Social Studies, 05.02.2020 07:58
Mathematics, 05.02.2020 07:58
Social Studies, 05.02.2020 07:58
Physics, 05.02.2020 07:58
Chemistry, 05.02.2020 07:58
History, 05.02.2020 07:58