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
Anit [1.1K]
3 years ago
12

Describe how catching exceptions can help with file errors. Write three Python examples that actually generate file errors on yo

ur computer and catch the errors with try: except: blocks. Include the code and output for each example in your post. Describe how you might deal with each error if you were writing a large production program. These descriptions should be general ideas in English, not actual Python code.
Computers and Technology
1 answer:
vovangra [49]3 years ago
8 0

Answer:

Three python errors are; import error, value error, and key error.

Explanation:

Errors occur in all programming languages and just like every other language, python has error handling techniques like the try and except and also the raise keyword.

A value error occurs when an output of a variable or expression gives an unexpected value. Import error results from importing a module from an unknown source while a key error is from a wrong input keypress.

Catching these errors and raising an error gives more control and continuity of the source code.

You might be interested in
A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the sub
kykrilka [37]
What language are you programming in? 

<span>If you are programming in C or C++, you could do something like this: </span>

<span>#include <iostream> </span>
<span>using namespace std; </span>

<span>int main(void) </span>
<span>{ </span>
<span>//declarations </span>
<span>double item1 = 0; </span>
<span>double item2 = 0; </span>
<span>double item3 = 0; </span>
<span>double item4 = 0; </span>
<span>double item5 = 0; </span>
<span>double subtotal = 0; </span>
<span>double total = 0; </span>
<span>double tax = 0; </span>

<span>//Enter Items </span>
<span>cout << "Please enter the price of item 1"; </span>
<span>cin >> item1; </span>

<span>cout << "Please enter the price of item 2"; </span>
<span>cin >> item2; </span>

<span>cout << "Please enter the price of item 3"; </span>
<span>cin >> item3; </span>

<span>cout << "Please enter the price of item 4"; </span>
<span>cin >> item4; </span>


<span>cout << "Please enter the price of item 5"; </span>
<span>cin >> item5; </span>


<span>//Compute subtotal </span>
<span>subtotal = (item1 + item2 + item3 + item4 + item5 + item6); </span>

<span>//Compute amount of tax </span>

<span>tax = subtotal * (.06); </span>

<span>//Compute total </span>

<span>total = subtotal + tax; </span>

<span>//Display subtotal, total, and amount of tax </span>

<span>cout < " The subtotal of the sale is: " << subtotal << endl; </span>
<span>cout < " The amount of sales tax is: " << tax << endl; </span>
<span>cout < " The total of the sale is: " << total << endl; </span>

<span>return 0; </span>

<span>}//end of function main </span>


<span>I know this is a very very basic C++ program but I hope it helps and good luck on your project!</span>
5 0
3 years ago
Subscribe too my you tube channel for a brainiest
dimaraw [331]

Answer:

Ok

Explanation:

4 0
2 years ago
An organization requires secure configuration baselines for all platforms and technologies that are used. If any system cannot c
Romashka [77]

Answer:

C. Process a risk acceptance for 2633 and remediate 3124.

Explanation:

There are various business risks. Some are inherited risks while other are risks are associated with nature of business. It is dependent on business owners that they want to accept risk or mitigate the risk. Risk acceptance is based on the strategy of the management. In the given scenario Accounting Prod Production has low risk 2633 which is accepted while 3124 is high risk which is remediated.

8 0
2 years ago
PLZ ANSWER ALL MY QUESTION. Which line of code will display the variable num rounded to the nearest tenth?
zavuch27 [327]

Answer:

A

Explanation:

5 0
3 years ago
A strategic business unit​ (SBU) of a major corporation has high market share in its​ industry, but the growth rate of the indus
VLD [36.1K]

Answer:

Cash cow

Explanation:

A cash cow is seen or made reference to as that part of a business, investment, or product that provides a steady income or profit.

Basically a cash cow is a business unit, product line, or investment that has a return on assets (ROA) greater than the market growth rate. This is expressed with an Idiom to mean that it produces "milk" that is profit long after the cost of the investment has been recouped.

The strategic business unit of this organization having high market share in its​ industry, but the growth rate of the industry is expected to be stagnant over the long run is simply yielding steady profit for the corporation through its high market value and this will continue for longer because it has to be at that high rate for a long period of time.

The SBU can be categorised as acting as the cash cow for that corporation.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Jim wants to develop an app for a specific purpose that would run even when his computer is not connected to the Internet. What
    11·1 answer
  • In Outlook 2016, what are the three format options when sending an email message? Check all that apply.
    7·1 answer
  • A financially stable person is able to
    12·2 answers
  • You are trying to log in to your old computer, and can't remember the password. You sit for hours making random guesses... I'm s
    10·1 answer
  • Which button would you use to insert a downloaded video clip on your computer into a slide?
    15·2 answers
  • A user notices that a mobile device is draining power faster than is normal. What are three causes of quick battery drain? (Choo
    5·1 answer
  • What are 25 items that trees made?
    6·2 answers
  • What are the routes through with Virus transmitted into computer<br>system?​
    15·1 answer
  • Describe how you will lunch a web browser using the start menu​
    6·2 answers
  • Customer history is an example of what
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!