Search Header Logo

Worksheet Questions: Errors and Exception Handling

Authored by Ажаргуль Мухамадин

Computers

10th Grade

Worksheet Questions: Errors and Exception Handling
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an error?

A command used to execute a program quickly

A problem that occurs during program execution or due to syntactic writing

A function that shortens and optimizes code

A tool that automatically fixes a program

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a SyntaxError?

The program does not work correctly

An error that occurs during writing the code

The data type does not match

A division-by-zero error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

For what purpose is the try-except construct used?

To shorten code

To read or write files

To prevent or handle errors

To create a conditional operator

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the code x = int("abc"), which error occurs?

SyntaxError

ValueError

TypeError

ZeroDivisionError

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the role of the finally block?

It repeats the try block

It executes only if no error occurs

It executes only if an error occurs

It executes whether an error occurs or not

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is written in the except block?

Code that runs when an error occurs

Only print()

If statements

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When does a ValueError occur?

When a non-numeric value is converted to a number

When there is a list index error

When dividing by zero

When the length of a string is zero

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?