1 svar
121 visningar
sale 48
Postad: 14 dec 2023 22:18

python with replit compiler

Hi,

I have installed sympy@1.12 in replit compiler och nothing happens when i run the following code.

from sympy import Symbol, Derivative
x = Symbol("x")
f = (x**2)
d = Derivative(f, x)
d.doit()

what i am missing?

 

thanks

fredrikd2 3
Postad: 14 jan 17:01

Something happens for sure, you just don’t see what happens. Like in the example below, from 

https://www.geeksforgeeks.org/python-sympy-doit-method/amp/, assign the result of the call to doit() to a variable and then print the value of that variable:

# calling doit() method on expression
geek = (2 * Integral(x, x)).doit()
print(geek)

Svara
Close