Exam 9: Files and Exceptions  

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(33)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.9/5
(37)

Various types of exceptions can occur when you work with files. Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(32)

The int function raises a ________ if you attempt to convert to an integer a string (like 'hello') that does not represent a number.

(Multiple Choice)
4.9/5
(45)

Which of the following statements are false?

(Multiple Choice)
4.7/5
(44)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.9/5
(40)

The following code uses exception handling to xe "except clause"catch and xe "handle (or resolve) an exception"handle any ValueErrors and ZeroDivisionErrors that arise. 1 while True: 2 try: 3 number1 = int(input('Enter numerator: ')) 4 number2 = int(input('Enter denominator: ')) 5 result = number1 / number2 6 except ValueError: 7 print('You must enter two integers\n') 8 except ZeroDivisionError: 9 print('Attempted to divide by zero\n') 10 else: 11 print(f'{number1:.3f} / {number2:.3f} = {result:.3f}') 12 break Where in the code could either or both of these errors arise?

(Multiple Choice)
4.9/5
(38)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(33)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.9/5
(37)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(41)
Showing 21 - 30 of 30
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)