Question: Problem 1 : Multiplication of Polynomial Texts ( hw 0 _ p 1 . py ) In mathematics, a polynomial is an expression consisting of
Problem : Multiplication of Polynomial Texts hwppy
In mathematics, a polynomial is an expression consisting of variables and coefficients, that involves
only the operations of addition, subtraction, multiplication, and nonnegative integer exponents of
variables. An example of a polynomial of a single variable is An example in three
variables is
In this homework, your task is to write a program to allow a textversion multiplication of multiple
polynomials. Specifically, the user is allowed to input a string that represents the multiplication of
several polynomials. Then you program needs to generate the string of the resulting polynomials.
The input and output polynomial strings need to follow the following rules.
means is the coefficient, is the variable, and is the coefficient of variable In
other words, coefficients are always placed before variables.
represents where is the variable, and is the exponent of That said,
exponents are always placed after variables.
Polynomials with the same variables need to be put together by adding their coefficients, for
example, should be
Note that you can use only pure Python, ie you cannot use any package.
Sample InputOutput:
c: Pythonworkspace hwhwppy
Input the polynomials:
Output Result:
C: Py thon workspace hwhw
ppy
Input the polynomials:
Dutput Result:
C: Pythonworkspacehwhw
ppy
Input the polynomials:
Output Result: ABCABC
FAQ
The polynomials entered in the first question need to be enclosed in eg XXY
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
