- 4
What is print 4*.__ -1 result=8 so, what's the number come in the space you can write only one number
6 Réponses
+ 1
Please write your question in a separate lines to can understand it and help you
+ 1
#Equation solving using python:
'''suppose the unknown value is "x". So, 4*x - 1 = 8
Or, 4*x - 1 - 8 = 0
Or, 4*x - 9 = 0'''
from sympy.solvers import solve
from sympy import Symbol
x = Symbol('x')
print(solve(4*x - 9, x))
#Output: [9/4]
0
4 * x -1 = 8
4x -1 = 8
4x = 8 +1
4x = 9
x = 9/4= 2.25
0
MD. Ferdous Ibne Abu Bakar wow. This is great. Thank you.
I tried to solve the equations and this is what I got:
https://code.sololearn.com/c8AFbgHsTqZX/?ref=app
Although, both methods couldn't determine repeated root. So there will be no difference between x-1=0 and (x-1)*(x-1)=0 in code results.
Any ideas?
0
Ashkan Sh 🇺🇦🇺🇦🇺🇦
from sympy import *
x = Symbol('x')
eq = simplify((x+1)*(x+1))
x1 = solve(eq, x)
y = simplify((x+x1[0]))
print(f'{y} = 0')