变量没有定义,我不知道如何定义它


Vsub=V.subs(-(2 - x**4)**(3/2)/6,0)
print('The volume when x=0 is',Vsub)
Name error: name 'V' is not defined 

isympy会话中,

In [114]: V = sympify('-(2-x**4)**(3/2)')                                                            
In [115]: V                                                                                          
Out[115]: 
3/2
⎛     4⎞   
-⎝2 - x ⎠   
In [116]: V.subs({x:0})                                                                              
Out[116]: -2⋅√2

最新更新