Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Debugging Activity Read. analyze and respond to errors in code. Instructions: Read through the below sample code. Predict what will be printed out. Remember that

Debugging Activity

Read. analyze and respond to errors in code.

Instructions:

  1. Read through the below sample code.

  2. Predict what will be printed out. Remember that when reading through code we go line by line, as if we are the interpreter.

  3. Run the code, display the stack trace, and analyze the error message reported.

Code Example

1 favorite_number_str = input("What is your favorite number: ")

2 birth_month_str = input("What month were you born in: ")

3

4 lucky_number = int(favorite_number_str) + int(birth_month_str)

5 print("Your lucky number is " + lucky_number)

Debugging is the process of tracking and fixing errors in your code.

Indentation Errors: "IndentationError: unindent does not match any outer indentation level"

Discussion Questions:

Why are these errors caused and how they nd/x this type of error?

Suggest using the tab key to indent and the shift-tab to remove an indent as ways to avoid the error.

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 Databases questions