mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-28 07:21:07 +00:00
Merge pull request #271 from cclauss/patch-6
from __future__ import print_function For Python 3
This commit is contained in:
commit
3899f9b507
|
@ -8,6 +8,8 @@ method 2:
|
|||
"Simpson Rule"
|
||||
|
||||
'''
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
def method_2(boundary, steps):
|
||||
# "Simpson Rule"
|
||||
|
@ -41,7 +43,7 @@ def main():
|
|||
steps = 10.0 #define number of steps or resolution
|
||||
boundary = [a, b] #define boundary of integration
|
||||
y = method_2(boundary, steps)
|
||||
print 'y = {0}'.format(y)
|
||||
print('y = {0}'.format(y))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -7,6 +7,7 @@ method 1:
|
|||
"extended trapezoidal rule"
|
||||
|
||||
'''
|
||||
from __future__ import print_function
|
||||
|
||||
def method_1(boundary, steps):
|
||||
# "extended trapezoidal rule"
|
||||
|
@ -39,7 +40,7 @@ def main():
|
|||
steps = 10.0 #define number of steps or resolution
|
||||
boundary = [a, b] #define boundary of integration
|
||||
y = method_1(boundary, steps)
|
||||
print 'y = {0}'.format(y)
|
||||
print('y = {0}'.format(y))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user