1. Engineering
  2. Computer Science
  3. need help in python programming in question 2 part a...

Question: need help in python programming in question 2 part a...

Question details

need help in python programming in question 2 part a and b

(a)

2.19 LAB: Equation verification Consider the following simple equations: The following code attempts the verify the above equations: a3 b- 5 a2-a*2 eql sum- a2 2ab b2 eq2_sum -a2 -2ab + b2 egl_pow-(a + b)*2 print print (Ist equation : (2nd equation: %g %h 80, %h, % % (eq1-sun, (eq2_pow, eq1-pow)) eq2-pow)) - : Fix this program by identifying and correcting erroneous statements, syntax errors, etc.

(b)

2.20 LAB: Quadratic equation Given the quadratic equation the two roots are - 4ac 2a and 2a Identify the problem with the following code, designed to calculate the two roots, and fix it. import math b - 26 c-3 q-math . sqrt (b*b- 4a*c) x1-(-b + g)/2*a x2 (-b - q)/2*a print (X1-%g, x2-%g % (x1, x2))

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution