From 0516bde45f15755a4d0014c21e14ef52b894ec98 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 19 Mar 2018 03:25:29 +0100 Subject: [PATCH 1/3] from __future__ import print_function For Python 3 @ltdouthit __print()__ is a function in Python 3 --- Maths/TrapezoidalRule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Maths/TrapezoidalRule.py b/Maths/TrapezoidalRule.py index 2ad857390..52310c1ed 100644 --- a/Maths/TrapezoidalRule.py +++ b/Maths/TrapezoidalRule.py @@ -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() From 361532279052619e8fb705c7351ae22f8b76c11e Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 19 Mar 2018 03:27:22 +0100 Subject: [PATCH 2/3] from __future__ import print_function for Python 3 @ltdouthit __print()__ is a function in Python 3 --- Maths/SimpsonRule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Maths/SimpsonRule.py b/Maths/SimpsonRule.py index 51b5ed1e4..ef9da5e55 100644 --- a/Maths/SimpsonRule.py +++ b/Maths/SimpsonRule.py @@ -8,6 +8,8 @@ method 2: "Simpson Rule" ''' +from __future__ import print_function + def method_2(boundary, steps): # "Simpson Rule" From 4fd777e3b42d8c775497f55851b209077a34872e Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 19 Mar 2018 03:28:00 +0100 Subject: [PATCH 3/3] Update SimpsonRule.py --- Maths/SimpsonRule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maths/SimpsonRule.py b/Maths/SimpsonRule.py index ef9da5e55..091c86c17 100644 --- a/Maths/SimpsonRule.py +++ b/Maths/SimpsonRule.py @@ -43,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()