diff --git a/Maths/SimpsonRule.py b/Maths/SimpsonRule.py index 51b5ed1e4..091c86c17 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" @@ -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() 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() diff --git a/Project Euler/Problem 10/sol1.py b/Project Euler/Problem 10/sol1.py index 2df3b6b59..94e5b7362 100644 --- a/Project Euler/Problem 10/sol1.py +++ b/Project Euler/Problem 10/sol1.py @@ -35,4 +35,4 @@ if __name__ == '__main__': n = int(sys.argv[1]) print(sum_of_primes(n)) except ValueError: - print('Invalid entry - please enter a number.') \ No newline at end of file + print('Invalid entry - please enter a number.') diff --git a/README.md b/README.md index d20244c2a..9b394e001 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ __Properties__ ###### View the algorithm in [action][shell-toptal] -### Time-Compexity Graphs +### Time-Complexity Graphs Comparing the complexity of sorting algorithms (Bubble Sort, Insertion Sort, Selection Sort) diff --git a/dynamic_programming/matrix_chain_order.py b/dynamic_programming/matrix_chain_order.py index 839db03d8..011e85755 100644 --- a/dynamic_programming/matrix_chain_order.py +++ b/dynamic_programming/matrix_chain_order.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import sys ''' Dynamic Programming