Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview Fix errors in a program Description Being able to fix errors in your own or others' code is an important aspect of computer programming.

image text in transcribed
image text in transcribed
Overview Fix errors in a program Description Being able to fix errors in your own or others' code is an important aspect of computer programming. This lab will focus on facing some of the most common errors. This process of finding and correcting errors is known as debugging. Take note of these errors as they are likely to be some of the errors you will encounter in future labs and projects. Objective The code given is supposed to print out "Hello World, a name that the user has input, and the value for 0. However, the code as given has several errors that prevent it from running. You are to fix the errors within the code. But wait! Even if you immediately see how to fix the errors, don't until you run the program and observe what the interpreter is or isn't telling you for each kind of error. Likewise if you don't see the problem immediately, do not just ask your TA what it is - they have been instructed not to just give you the answer. However, they may give you hints if you have struggled for a long time. It is recommended that you run the program as is first, then fix one error, run it again, fix the next error, etc, foxing only one error at a time while observing the behavior at each step The purpose of this lab is to give you experience in what certain kinds of errors look like before you know there are errors. If you immediately fix the errors, get 100%, and move on, or if you ask someone else for the correction, get 100%, and move on, you have not accomplished the goal of this lab. Each error is preceded by a comment (like ## Fix the below error) describing the error and how these errors should be fixed An example run of your program is as follows: First the program will prompt for your name, asking 'Enter a name' Then, If the input is: Your Name Then output should be Hello World The world says hello to Your Name Your Name LAB ACTIVITY 16.4.1: LAB 3 D Spring 20: Code Debugging 0130 U main.py Load default template. 1 Fix the below Syntax/EOL Error 2 print("Hello world! ) 4 Fix the Error with the input statement 5 name - input("Enter A Name:-) 7 Fix the Error in the below sath statement B Hint Divsion by zero raises an error (remove division by 0) 9 tend- 11 Fix the Error with the print statment 12 print("The world says hello to, name: ") 14 - Fix the syntax error below 15 print(name) print (ro)

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

Question

Explain the technique known as destructive update.

Answered: 1 week ago