Open hug2wisdom opened 4 years ago
The keyword argument end
can be used to avoid the newline after the output, or end the output with a different string:
>>> a, b = 0, 1
>>> while a < 1000:
... print(a, end=',')
... a, b = b, a+b
...
0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,
If you don’t want characters prefaced by
\
to be interpreted as special characters, you can use raw strings by adding anr
before the first quote: