python - Extracting result from integration (quadrature)? -


consider python snippet:

>>> 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>>>> 

how v equal 0.10217888319247767, (e.g.) 3*v=.30653664957743301 (i.e., “de-tuple” it)?

you can index tuple this: 3*v[0]


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -