+ 1

What is the steps to make python solve (x + 2)**3 ?

4th Mar 2018, 2:06 PM
Henrique Laudares Zordan
8 ответов
+ 2
Define x first and then solve.
4th Mar 2018, 2:19 PM
Pravin Pandey
Pravin Pandey - avatar
+ 2
you just define the x? I can't seem the crasp the problem here. def solver(x): answer = (x + 2) ** 3 print(answer) solver(1) output is 27 , simple math
4th Mar 2018, 2:19 PM
Markus Kaleton
Markus Kaleton - avatar
+ 2
right, I see, you want to expand the polynomial
4th Mar 2018, 3:28 PM
Amaras A
Amaras A - avatar
+ 1
I want it to make (x + 2)**3 into x**3 + 6*x**2 + 12*x + 8
4th Mar 2018, 2:25 PM
Henrique Laudares Zordan
0
what do you mean?
4th Mar 2018, 2:09 PM
Obbu
Obbu - avatar
0
if u need result y of the first function to be the next x you can reuse the code i posted above. if this is not the case you need to give alot! more information on what you are trying to achieve
4th Mar 2018, 2:53 PM
Markus Kaleton
Markus Kaleton - avatar
0
I'm trying to expand the polynomial, as Amaras A. just said. Like: (a + b)**2 = a**2 + 2*a*b + b**2
4th Mar 2018, 6:34 PM
Henrique Laudares Zordan
0
ok, so, I have a polynomial code, but I have not yet implemented the code for exponentiation...
4th Mar 2018, 7:08 PM
Amaras A
Amaras A - avatar