从积分(正交)中提取结果?

时间:2014-09-21 01:29:09

标签: python

考虑这个Python片段:

>>> V=quad(lambda x:sin(x),0,.456)

>>> print "V=",V; 3*V<br>

V= (0.10217888319247767, 1.1344134875077312e-15)
(0.10217888319247767, 1.1344134875077312e-15,
0.10217888319247767, 1.1344134875077312e-15,   
 0.10217888319247767, 1.1344134875077312e-15)<br>>>>

如何让V等于0.10217888319247767,这样 (例如)3 * V = .30653664957743301(即“de-tuple”)?

1 个答案:

答案 0 :(得分:0)

您可以像这样对元组建立索引:3*V[0]