Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

im trying to identify the error but im not able to figure it out In this activity, we will practice handling errors. The code in

im trying to identify the error but im not able to figure it out

In this activity, we will practice handling errors. The code inSnippet 9.53throws an error.

The following code throws an error:

importrandom

print(random.randinteger(5,15))

Identify and handle the error so that when it occurs, the message is printed to the terminal.

Steps for Completion

  1. Go to yourmain.pyfile.
  2. Take the code block fromSnippet 9.53, and amend to it so that it catches the error, using atry... exceptblock.
  3. Within thetry... exceptblock make the exception look for anAttriubuteErrorand printDouble check the attributes in your code and try again.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions

Question

please try to give correct answer 1 9 3 .

Answered: 1 week ago