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
Helen [10]
3 years ago
5

The function below tries to create a list of integers by reading them from a file. The file is expected to have a single integer

per line and the code works correctly in that case. If any of the lines don't contain just an integer, than this code fails. Fix this code so that it ignores any lines that don't contain integers instead of raising an exception. Do this with try/except blocks. Your code should still return the list of integers from the lines that contain integers.

Computers and Technology
1 answer:
Setler [38]3 years ago
4 0

Answer:

Check the explanation

Explanation:

def get_list_of_integers_from_file(filename):

int_list=[]

for line in open(filename).readlines():

try:

int_list.append(int(line))

except:

continue

return int_list

print(get_list_of_integers_from_file('file.txt'))

 

File.txt:

Kindly check the output below.

You might be interested in
Items that are cut or copied are placed on the Clipboard.
WINSTONCH [101]

Anwer is <u>True</u>

please mark me brainliest answer

7 0
3 years ago
Read 2 more answers
Your wearable device synchronized with your smartphone this morning when you turned it on, but the two devices no longer are syn
Lady_Fox [76]
<span>There are several reasons why two devices are not synchronized: maybe there are not the same versions of the programs on both devices, maybe the software needs restart in order to have the latest input data, maybe the internet connection was lost during synchronization

Next steps would be:
- restart the devices
- Update to the latest version
- connect to the internet
- make the synchronization again
</span>
7 0
3 years ago
For each of the users of accounting information, identify whether the user is an external decision maker (E) or an internal deci
jarptica [38.1K]

Answer:

Customer (E), Company manager (I), Internal Revenue Service (E), Lender (E), Investor (E), Controller (I), Cost accountant (I), SEC (E).

Explanation:

First of all, we need to define what exactly is an External Decision Maker (E) and an Internal Decision Maker (I).

External Decision Makers, these are people <u><em>outside the company</em></u><em> </em>that make decisions, for example: Customer, Internal Revenue Service, Lender, Investor and The U.S. Securities and Exchange Commission (SEC).

<u>Customers</u> are external because they don't belong to the company.

<u>Internal Revenue Service </u>is an institution of the  Government of the U.S., that's why is outside the company.

<u>Lender</u>, this person or financial institution is not involved in the company in self, only lends money to the company, that's it.

<u>Investor,</u> as it was said above, it's the person or institution that only lends the money to the company, without being part of the insides.

<u>The U.S. Securities and Exchange Commission (SEC)</u> is an institution of the U.S. Government, so it's outside the company.

Internal Decision Makers, these are people inside the company, they are absolutely involved in the direct decisions, for example, Company Manager, Controller and Cost Accountant.

<u>Company Manager</u> is the head of the company, the person in this position absolutely makes company decisions to coordinate all departments.

<u>Controller</u>, this person has the responsibility of all accounting related activities, that's why is an internal decision maker.

<u>Cost Accountant,</u> is an internal decision maker because is the person in this position has to be a financial specialist who determines costs of the products or services that the company offers.

So, there you have it, it's a pleasure to help.

4 0
4 years ago
Which device makes telecommunications possible?
Dmitrij [34]
A. modem or d. voice input. Not a port because a port allows one to insert a peripheral device but not really communicate. I have no idea what an expansion slot is. It could be d. voice input because this allows a person to hold an audible conversation.

But  I'd go for modem because a modem lets you connect devices like laptops, tablets, phones, computers etc. and share data between them. So things like mailing are possible (I THINK)!  <span />
7 0
3 years ago
A server technician has been tasked with purchasing cables and connectors for a new server room. The server room consists of one
Rama09 [41]

Answer:

The answer is "Option b"

Explanation:

A straightforward cable is a form of twisted pair cable, which is used in the  LAN cable, it provides the connections to RJ-45 cable, that pinout to each end for the same connection. In this cable, that is a sequel, the same kind of computer was interlinked for used by the same routers ports, that's why the technician purchase this cable, and certain options were incorrect that can be described as follows:

  • In option a, It is used in the television, that's why it is wrong.
  • Option c and Option d both were wrong because It is used in telephones, that provides low-speed apps, and it terminates the network.
5 0
3 years ago
Other questions:
  • Use a colon before a list and put one space after a colon. True False
    15·2 answers
  • To extend the bottom border of a hyperlink across the complete width of a navigation list, change the ____ property of each hype
    9·1 answer
  • The picture that graphically represents the items you use in Windows is called a/an
    12·2 answers
  • How assemblers and linkers work together?
    13·1 answer
  • A bus topology network is most often deployed as a peer-to-peer network. <br> a. True <br> b. False
    7·1 answer
  • Which component is a part of the CPU of a computer
    12·2 answers
  • Analytical CRM systems are the input for operational CRM systems.<br><br> True<br><br> False
    11·1 answer
  • The duties of a database administrator include determining which people have access to what kinds of data in the database; these
    13·2 answers
  • Which is an aspect of structural-level design?
    6·2 answers
  • Choose the tag required for each stated goal.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!