from __future__ import print_function For Python 3

@ltdouthit __print()__ is a function in Python 3
This commit is contained in:
cclauss 2018-03-19 03:25:29 +01:00 committed by GitHub
parent 6035672096
commit 0516bde45f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ method 1:
"extended trapezoidal rule" "extended trapezoidal rule"
''' '''
from __future__ import print_function
def method_1(boundary, steps): def method_1(boundary, steps):
# "extended trapezoidal rule" # "extended trapezoidal rule"
@ -39,7 +40,7 @@ def main():
steps = 10.0 #define number of steps or resolution steps = 10.0 #define number of steps or resolution
boundary = [a, b] #define boundary of integration boundary = [a, b] #define boundary of integration
y = method_1(boundary, steps) y = method_1(boundary, steps)
print 'y = {0}'.format(y) print('y = {0}'.format(y))
if __name__ == '__main__': if __name__ == '__main__':
main() main()