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

时间:2020-09-08 00:19:04

标签: jupyter

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 

1 个答案:

答案 0 :(得分:0)

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