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
write a function that takes two integer arrays as input return true if any two of the numbers in the first array input add up to
Afina-wow [57]

Answer:

Explanation:

This program is written in Python. It is a function that takes in two arrays. Then it loops through the first array twice, adding each element with the others and comparing the sum to the values in the second array. If a similar value is found in the second array, the program prints out the value and returns True to the user. Otherwise, it returns False. A test case has been created with two array variables that print out False, the output can be seen in the attached image below.

def sumArray(arr1, arr2):

   for i in range(len(arr1)):

       for x in range(len(arr1)):

           sum = 0

           if i != x:

               sum = arr1[i] + arr1[x]

           if sum in arr2:

               print(str(sum) + "Found in Second Array")

               return True

   return False

arr1 = [1, 9, 10, 44]

arr2 = [2, 4, 8, 14]

print(sumArray(arr1, arr2))

8 0
3 years ago
If you paste a word document text into an excel spreadsheet, the paste optio allow you to keep source formatting or
castortr0y [4]
I think the answer is c
6 0
3 years ago
What is the extension of Qbasic ?​
abruzzese [7]

There are four types of operator in QBASIC. They are Arithmetic operators,relational operators,logical operators and sting operator .a. arithmetic operators. Arithmetic operators are used to preform mathematical calculations like addition, subtraction, division, multiplication and exponential

7 0
2 years ago
Read 2 more answers
When did the silent movie era end?<br> A.1919<br> B.1929<br> C.1939<br> D.1949
11111nata11111 [884]

Answer:

The answer is 1929.

5 0
3 years ago
Read 2 more answers
You enter the show ipv6 route command on an ospf device and the device displays a route. which conclusion can you draw about the
salantis [7]
<span>OSPFv3 is in use.......</span>
4 0
3 years ago
Other questions:
  • Henry bought a new card for capturing television on his computer. When he finished going through the packaging, though, he found
    5·1 answer
  • Which word in brackets is most opposite to the word in capitals? PROSCRIBE (allow, stifle, promote, verify)​
    14·2 answers
  • Kiera is building a new computer and wants to make sure she has an adequate power supply for all the new equipment she is purcha
    15·2 answers
  • Any part of the computer that you plug into the CPU like a phone, tablet, headphones etc. are called
    5·1 answer
  • Image-editing software is used to _____.
    15·2 answers
  • What is Automation ? Please give an example ?
    14·1 answer
  • Choose the parts of the browser window. PLEASE ANSWER QUICKLY TEST
    12·2 answers
  • Directions and Analysis
    15·1 answer
  • Create a text file content.txt and copy-paste following text (taken from Wikipedia) into it: A single-tasking system can only ru
    7·1 answer
  • Name various input and output devices used with computers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!