You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d6c4aa
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Reference/api_en/print.xml
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,16 @@ print(list_of_stuff)
25
25
The <b>print()</b> function writes to the console area, the black rectangle at the bottom of the Processing environment. This function is often helpful for looking at the data a program is producing.<br/>
26
26
<br />
27
27
Using <b>print()</b> on an object will output a string representation of that object, as determined by its internal <b>__str__</b> and <b>__repr__</b> methods (<a href="http://stackoverflow.com/a/2626364">more information here</a>).<br/><br/>
28
-
In Python Mode, <b>print()</b> and <b>println()</b> are functionally identical.
28
+
In Python Mode, <b>print()</b> and <b>println()</b> are functionally identical.<br />
29
+
<br/ >
30
+
Under the hood, <b>print</b> in Python 2 is not actually a function at all--it
31
+
is a statement, and can be used without quotes: <b>print i</b>. Writing
32
+
<b>print(i)</b> is <b>print</b> plus the single-element expression <b>(i)</b>.
33
+
When we write <b>print(1,2)</b>, the statement outputs a tuple: <b>(1, 2)</b>.
34
+
To change this behavior, make the first line of a sketch: <b>from __future__
35
+
import print_function</b>. This turns <b>print(i)</b> into a function, disallows
36
+
<b>print i</b>, and causes <b>print(1, 2)</b> to output <b>1, 2</b> rather than
0 commit comments