first_interal_one = ((8**3) / (3.0)) #spaces around operators such as "=" or "+" is good form first_integral_two = (2.0*((8**2)/(2.0))) second_integral_one = ((2**3) / (3.0)) second_integral_two = (2.0*((2**2)/(2.0))) coefficient_for_all = 3.14 print "The solution to the integral is", coefficient_for_all*((first_interal_one - first_integral_two) - (second_integral_one - second_integral_two)), #when floats are used, the exact number of places after the decimal are preserved (both the accuracies of the largest number and the smallest number are maintained?)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question