aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/spec.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/spec.md b/doc/spec.md
index 8acccdb..b8f7379 100644
--- a/doc/spec.md
+++ b/doc/spec.md
@@ -3055,14 +3055,17 @@ See also: `chr`.
### print
-`print(*args, **kwargs)` prints its arguments, followed by a newline.
-Arguments are formatted as if by `str(x)` and separated with a space.
+`print(*args, sep=" ")` prints its arguments, followed by a newline.
+Arguments are formatted as if by `str(x)` and separated with a space,
+unless an alternative separator is specified by a `sep` named argument.
Keyword arguments are preceded by their name.
Example:
```python
-print(1, "hi", x=3) # "1 hi x=3\n"
+print(1, "hi") # "1 hi\n"
+print("hello", "world") # "hello world\n"
+print("hello", "world", sep=", ") # "hello, world\n"
```
Typically the formatted string is printed to the standard error file,