Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Be able to recognize common programming errors. Description This lab will cover both interpreter errors and logic errors. You will be given code that is

Be able to recognize common programming errors. Description This lab will cover both interpreter errors and logic errors. You will be given code that is not correct. Based on the comments in the code and the errors messages received when running the code, you should be able to fix the errors Objective By the end of the program, you should be able to recognize the following types of errors Variable usage Bugs Identifier/ variable name Bugs String literal versus variable Bugs . Arithmetic Bugs Reminder. These are common bugs that people make when writing code Learning how to find them and how to fix them will help you greatly in this class. It is also good practice to try to understand code you have not written that will again make you a better coder Extra Note About variable names: The chapter listed all the Python keywords that cannot be used as variable names. There are others that you should also never use, such as input' Using "Input as a variable can cause drastic results and freeze your environment. Fix the bugs in the code that is given. As in last week's lab, do not immediately fix all the bugs you see, Instead, run the program first as it is given Observe the error it is giving you. Then fix the first bug and run it again. Observe the next error message, fix it, and run it. Continue fixing the errors one at a time again the purpose is not to get the right answer", it is to give you experience and practice in recognizing certain types of errors that occur when they are not introduced on purpose 301826. 7742850 LAD ACTIVITY 3.14. 1: LAB 3D More Code Debugging 0/25 main.py Load default template 2 Fix the error in the lines below. 3 Sy-trout Cint("Enter a number: >> 6 X'y - y 7 print Your number tines 6 is", y) . Hint: If x is 6 ond y is 9, this should print 54 9 10 Fix the errors in the code below 11 12 1stplace input who got first place? 13 Secondplace "onnet 14-3rdploce - Sohn 15 16 print("First place was", 1stplace, second place nos". Secondplace, third place was"..3rdplace.end." ") 17 18 Hint: If you change a variable nama/identifier make sure to change it in all places

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Recommended Textbook for

Intermediate Accounting

Authors: James D. Stice, Earl K. Stice, Fred Skousen

17th Edition

978-0324592375

Students also viewed these Programming questions

Question

Can public works increase equilibrium wages?

Answered: 1 week ago