Question: Write a code which reads a text file containing polynomials f1, f2, ..., fk and takes an input value x0 from a user and calculates

Write a code which reads a text file containing polynomials f1, f2, ..., fk and takes an input value x0 from a user and calculates the values f1(x0), f2(x0), ..., fk(x0) and writes these values to the same text file according to the format shown in the following: x_2=2 should be inside of the code input= input1.txt f1(x): +3x^2 + 2x^1 -5x^0 f2(x): -5x^3 + 1x^1 +7x^0 f3(x): +4x^4 - 2x^0 output: f1(x): +3x^2 + 2x^1 -5x^0 f2(x): -5x^3 + 1x^1 +7x^0 f3(x): +4x^4 - 2x^0 f1(2): 11 f2(2): -31 f3(2): 62 We are not allow to use import and .findall Write a code which reads a text file containing polynomials f1, f2, my code ..., fk and takes an input value x0 from a user and txt file : calculates the values f1(x0), f2(x0), ..., fk(x0) and writes these values to plz check the code this is my third time sending the question thank you

4. Write a code which reads a text file containing polynomials f1,f2,,fk and takes an input value x0 from a user and calculates the values f1(x0),f2(x0),,fk(x0) and writes these values to the same text file according to the format shown in the following: Sample input and output Note 1: There is at least one space between the terms of each polynomial fi(x) in the input text file. Use these spaces for splitting purposes. Note 2: You are allowed to use Python's pow () function when calculating fi(x0). alueError 11 In[8], line 26 if coeff_power[8]: coeff_value = int ( coeff_power [0][1:]) if coeff_sign == ' - ' \[ \text { coeff }=\text {-coeff_value } \] alueerror: invalid literal for int() with base 10: " f1(x):+3x2+2x15x f2(x):5x3+1x1+7x f3(x):+4x42x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!