2. (20 pts) The Python script below includes some syntax errors. Please find and correct them....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. (20 pts) The Python script below includes some syntax errors. Please find and correct them. Notes: You should write your answers as comments at the end of your 1st question's script. Your answers should indicate the line number where the error occurs and also the corrected version of that line. Answer Example: # Line 23 Corrected: name input(' What is %3D your name?") # Line 27 Corrected: x x+ 3 # Line 35 Corrected: strl, str2 = "Empty" %3D Warning: If your answer is not given like the format described in the above example, your answer will not be graded! numberl = int (input ('Enter an integer: ")) 2. print ('First number is', (nunberl}, number2 = input (2) number2 = int (number2) print (f'Second number is number2).') = numberl + number2 '.') 13 4 sum 7 print ('Sum of these two numbers is ', sum, 1.') 8. real div = sum / 2 print ('Average of these two numbers is real div = sum // 2+ (sum % 2) / 2 print (f'Average of {numberl, and number2) is (real div).') print () 6. real div + .') 10 11 12 O HN 2. (20 pts) The Python script below includes some syntax errors. Please find and correct them. Notes: You should write your answers as comments at the end of your 1st question's script. Your answers should indicate the line number where the error occurs and also the corrected version of that line. Answer Example: # Line 23 Corrected: name input(' What is %3D your name?") # Line 27 Corrected: x x+ 3 # Line 35 Corrected: strl, str2 = "Empty" %3D Warning: If your answer is not given like the format described in the above example, your answer will not be graded! numberl = int (input ('Enter an integer: ")) 2. print ('First number is', (nunberl}, number2 = input (2) number2 = int (number2) print (f'Second number is number2).') = numberl + number2 '.') 13 4 sum 7 print ('Sum of these two numbers is ', sum, 1.') 8. real div = sum / 2 print ('Average of these two numbers is real div = sum // 2+ (sum % 2) / 2 print (f'Average of {numberl, and number2) is (real div).') print () 6. real div + .') 10 11 12 O HN
Expert Answer:
Answer rating: 100% (QA)
Line 1 corrected number 1 intinputEnter an integer Line 2 corrected printFirst numb... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
please help explain and answer study question number 2 & 3 page discussion questions 1. refer to the fundamental principles governing an audit (see chapter 2@ ). under the responsibili
-
X Question 8 QUESTION 8-FINANCE/QUALITY A company that manufactures industrial wind turbine units use EN8 mild steel tubing in their production. Their production figures and customer orders suggested...
-
Under what circumstances can partners with passive losses from partnerships deduct their passive losses?
-
Under what circumstances is a shop-floor control system needed?
-
The technology consulting company Data Genetics suggests that 17.8% of all four-digit personal identification numbers, or PIN codes, have a repeating digits format such as 2525. Assuming this to be...
-
Regal Freightway provides freight service. The companys balance sheet includes Land, Buildings, and Motor-Carrier Equipment. Regal Freightway uses a separate accumulated depreciation account for each...
-
On January 1, 2013, Plains Power Company overhauled four turbine engines that generate power for customers. The overhaul resulted in a slight increase in the capacity of the engines to produce power....
-
develop a plan outlining five occupational health services recommended by the ILO that Fakude Manufacturing Ltd . can implement to improve the health and well - being of its employees. Consider the...
-
A researcher studied the number of anxiety attacks recounted over a two-week period by 30 people in psychotherapy for an anxiety disorder. In an article describing the results of the study, the...
-
The relation between flux density and vector potential is O B = Curl(A) O A = Curl(B) O B = Div(A) O A = Div(B) O none of the above
-
Discuss the general relationship between social justice movements and allyship. Does participation in a social justice movement make one an ally? What might be required when it comes to practicing...
-
The hospitality industry, more so than most other industries, is by its nature "global". Certainly, there are domestic tourists everywhere, especially in a country like the US, which is...
-
Explore the websites and corporate culture statements for the following organizations: Southwest Airlines https://careers.southwestair.com/culture(Links to an external site.)...
-
Olivet Devices sells two models of fitness devices. The budgeted price per unit for the wireless model is $48 and the budgeted price per unit for the wireless and cellular model is $93. The master...
-
Below is a matrix for a basic communication plan for collecting and distributing information in a timely manner. In the first column, the type of communication, which is the information being...
-
Through your own reasoning or research, where do you stand on the issue of unions? Are they outdated and costly in todays contemporary business environment, or are they still a necessary force for...
-
Activator rod AB exerts on crank BCD a force P directed along line AB. Knowing that P must have a 100-N component perpendicular to arm BC of the crank, determine (a) The magnitude of the force P, (b)...
-
Why is it said that there is no I in TEAM? Do you agree or disagree? How can you be an effective team member?
-
Describe how a global project can be more complex than a project performed within just one country. How might these elements affect the successful outcome of the global project?
-
Discuss why resources need to be considered when developing a schedule.
-
For the simple pendulum of Figure 5.33, derive the governing equation of motion assuming (a) that \(m\) is a point mass, and (b) that the mass is a sphere with small but finite mass moment of...
-
The lightweight bar in Figure 5.34 is released from rest when the spring is undeformed at \(\theta=0\). The two masses at \(A\) and \(B\) slide in frictionless guides that are horizontal at the left...
-
For Example 5.10, use Newton's second law of motion to derive the equations of motion. Example 5.10 The Generalized Force Consider the simple pendulum suspended from a block that can translate on a...
Study smarter with the SolutionInn App