[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ansari.aafaq1994 at gmail.com wrote: > Lets say i have a expression: > flowrate=(veloctiy*area) > i can find the flowrate with this expression > but if i dont wanna change the expression and want to find the velocity by > giving it value of area and flowrate ,how do i do this in python? is there > any library or package or module for this? With sympy ttps://docs.sympy.org/latest/tutorial/intro.html you can write: >>> import sympy >>> f, v, a = sympy.symbols("flowrate velocity area") >>> sympy.solve(v*a - f, a) [flowrate/velocity] >>> sympy.solve(v*a - f, f) [area*velocity]

- Prev by Date:
**Getting value of a variable without changing the expression in Python** - Next by Date:
**creating a csv from information I have printed to screen** - Previous by thread:
**Getting value of a variable without changing the expression in Python** - Next by thread:
**creating a csv from information I have printed to screen** - Index(es):