summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorven <vendethiel@hotmail.fr>2015-09-05 16:02:09 +0200
committerven <vendethiel@hotmail.fr>2015-09-05 16:02:09 +0200
commit9b8e7ddedd7333fd81e8501d5f15b429b32030ae (patch)
treeeab2975c30fdd75e5121f7b940615c7a40cd5cd5
parent9a2bc8211dde1c1701bc71af0bcbcbb288bbf8f9 (diff)
parent1ccebdf972dd000299f48689e3c1b756761fdb64 (diff)
Merge pull request #1227 from foochuanwei/patch-1
[Python3/en] Corrected Python3 print() function
-rw-r--r--python3.html.markdown4
1 files changed, 2 insertions, 2 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index fbed77fe..b3acb122 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -375,12 +375,12 @@ except (TypeError, NameError):
else: # Optional clause to the try/except block. Must follow all except blocks
print("All good!") # Runs only if the code in try raises no exceptions
finally: # Execute under all circumstances
- print "We can clean up resources here"
+ print("We can clean up resources here")
# Instead of try/finally to cleanup resources you can use a with statement
with open("myfile.txt") as f:
for line in f:
- print line
+ print(line)
# Python offers a fundamental abstraction called the Iterable.
# An iterable is an object that can be treated as a sequence.