Skip to content

Commit 3899f9b

Browse files
authored
Merge pull request TheAlgorithms#271 from cclauss/patch-6
from __future__ import print_function For Python 3
2 parents 5e21232 + 4fd777e commit 3899f9b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Maths/SimpsonRule.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"Simpson Rule"
99
1010
'''
11+
from __future__ import print_function
12+
1113

1214
def method_2(boundary, steps):
1315
# "Simpson Rule"
@@ -41,7 +43,7 @@ def main():
4143
steps = 10.0 #define number of steps or resolution
4244
boundary = [a, b] #define boundary of integration
4345
y = method_2(boundary, steps)
44-
print 'y = {0}'.format(y)
46+
print('y = {0}'.format(y))
4547

4648
if __name__ == '__main__':
4749
main()

Maths/TrapezoidalRule.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"extended trapezoidal rule"
88
99
'''
10+
from __future__ import print_function
1011

1112
def method_1(boundary, steps):
1213
# "extended trapezoidal rule"
@@ -39,7 +40,7 @@ def main():
3940
steps = 10.0 #define number of steps or resolution
4041
boundary = [a, b] #define boundary of integration
4142
y = method_1(boundary, steps)
42-
print 'y = {0}'.format(y)
43+
print('y = {0}'.format(y))
4344

4445
if __name__ == '__main__':
4546
main()

0 commit comments

Comments
 (0)