answer.
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
Ratling
2 days ago
14

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

Computers and Technology
1 answer:
Natasha_Volkova [890]2 days ago
4 0

Answer:To achieve that, implement 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
Suppose a linked list of 20 nodes. The middle node has a data –250. Write the pseudocode to replace the middle node of the linke
oksian1 [789]
The data for the middle node shows as –250.... Please outline the pseudocode to substitute the middle node in the linked list. Assume that the head pointer is designated as Head_ptr and the entry data for the new node is defined as Entry.
4 0
21 day ago
Read 2 more answers
In cell e5, create a formula using the vlookup function to determine the dog type for teen anna morante based on the program cod
Natasha_Volkova [890]
Hi! For utilizing the VLOOKUP function, you require the value to search for, the table’s range, and the specific column that has the return value. In your scenario, you provided both the range and the column; however, it’s unclear what value you wish to look up. For this explanation, let’s assume you want to search for the value in cell D5. Feel free to modify it according to your needs.

In syntax form, it will be:
=VLOOKUP(D5,G4:H7,2)
3 0
17 days ago
Read 2 more answers
Use Excel to develop a regression model for the Consumer Food Database (using the "Excel Databases.xls" file on Blackboard) to p
oksian1 [789]
Step 1: Use the provided formula to create an Indicator Variable for cities with metro areas. Step 2: Apply a filter to isolate data specific to metro cities, selecting only those marked with Metro Indicator 1. Step 3: Transfer the filtered data to a new worksheet. Step 4: Navigate to Data - Data Analysis - Regression. Step 5: Input the specified Y-variable and X-variable ranges as indicated. Choose the output range and ensure residuals are checked, which will produce the Output Summary and the Predicted Values alongside Residuals. Please see the accompanying attachment.
5 0
7 days ago
The budget process which emphasizes the achievement of goals and competition between alternatives is:
Rzqust [894]

The question offers several choices;


<span>A) </span>Incremental budgeting.
B) Performance budgeting.
C) Program budgeting.
D) Target based budgeting.


I'd argue that D is the correct option; Target based budgeting.


Target based budgeting centers on achieving objectives and competing alternatives. This budgeting approach uses pricing as a strategic tool to influence sales outcomes. It involves market research to determine the precise selling price of a product.






4 0
1 month ago
Assume that the reference variable r refers to a serializable object. Write code that serializes the object to the file ObjectDa
oksian1 [789]
To serialize an object, the following code can be used: FileOutputStream out = new FileOutputStream("ObjectData.dat"); ObjectOutputStream ostream = new ObjectOutputStream(out); ostream.writeObject(r); Explanation: For serializing an object, the writeObject method from the java.io.ObjectOutputStream class is utilized. The complete code snippet is as follows: import java.io.*; class Demo{ public static void main(String args[]){ try{ r = <reference to="" object="" be="" serialized="">; FileOutputStream out = new FileOutputStream("ObjectData.dat"); ObjectOutputStream ostream = new ObjectOutputStream(out); ostream.writeObject(r); ostream.close(); } catch(Exception e){ e.printStackTrace(); }} }. </reference>
5 0
16 days ago
Other questions:
  • Represent decimal number 8620 in (a) BCD, (b) excess-3 code, (c)2421 code, and (d) as a binary number
    7·1 answer
  • Assume that the following variables have been properly declared and initialized.
    12·1 answer
  • In what areas is Leslie's underspending hurting her budget select all that apply
    5·1 answer
  • Why computer is known as versatile and diligent device ?explain​
    14·1 answer
  • Why is computer called versatile machine?
    7·1 answer
  • Define a function print_feet_inch_short(), with parameters num_feet and num_inches, that prints using ' and " shorthand. End wit
    6·2 answers
  • Imagine you were using some of our pixelation tools to create an image and you posted it online for your friends to see - but, a
    11·1 answer
  • What is the other name designated to a game master of multiplayer online games (MMOs)?
    11·2 answers
  • What are the set of rules to move data from one computer to another?
    11·1 answer
  • Flowgorithm, Design a program that prompts the user to enter a number within the range of 1 through 10. The program should displ
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!