Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a = 3,3 b = 5,3 a2 = a^2 b2 = b^2 apb_lhs = a + b ** 2 apb_rhs = a2 + 2ab +
a = 3,3 b = 5,3 a2 = a^2 b2 = b^2 apb_lhs = a + b ** 2 apb_rhs = a2 + 2ab + b2 amb_lhs = a - b ** 2 amb_rhs = a2 - 2ab + b2 print( '(a+b)^2 = ', apb_lhs ) print( 'a^2+2ab+b^2 = ', apb_rhs ) print( '(a-b)^2 = ', amb_lhs ) print( 'a^2-2ab+b^2 = ', amb_rhs )Python: Finding and Correcting Bugs 1 point These exercises ask you to correct a candidste cooe by identifying the bugs which prevent it from executing and remedying them (This assignment is based n Langtangen, Exercise 1.9c.) You should verify the following two equations. To do this, you should correctly calculate four quantities: apb_1hs, apb_rhs, anb_lhs, amb_rhs , each corresponding to the appropriate part of the equation. (apb mears a +b, amb means a -b, and lhs and rhs respectively mean left-hand and right-hard sides). You should then output the results of each statenent to the screen. (a +b)+2ab+h (a-b- 2ab b 5,3 amb rhs = a2-2ab + b2 print( "( b)A2 = ., apb lhs) print( '(a-b)*2 - ', amb_lhs ) print( "#2 2abtb"2 : ", amb-rhs )
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started