Good question - you can! Just take what I did in the console and apply to your file, the syntax is the same. You can also use a Jupyter Notebook. Thanks
If I am solving an equation for x and I want to save the final answer (e.g., after running the solve(eqn, x) line), as simple float into a different variable name then how can I do that? I just need the value of x. Can you guide me?
Hi, good question. Yes, you can use "sympify" to convert the user input into something useable here. Here's a short example for you, if you were to do this on CoCalc where a user types in Eq(3+x, 23). In: from sympy.solvers import solve from sympy import Symbol x = Symbol('x') In: eqn = sympify(input("Type in your equation using Eq() formatting, please: ")) solve(eqn) Out: Type in your equation using Eq() formatting, please: Eq(3+x, 23) [20] You can do fancier things if you don't think your user will be familiar with that formatting, or you can lay out more instructions in your prompt inside the parentheses of your input() function, but the above should cover the general principle. Hope this is helpful, thanks for watching.
Yep, definitely - I go into different ways to define symbols in the intro tutorial here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-MGLFA7WjK7M.html