python print() prints, the default is a newline.
for example:
print('abc')
pirnt('xyz')
gives us
abc
xyz
what do I do if I want to get , abcxyz
, which is to print two lines and put them in one line.
can be used with the code:
print('abc',end='')
print('xyz')
so that the printed result does not have a line break:
abcxyz
before I saw someone on the Internet write this:
print('abc'),
print('xyz')
is comma separated, and this python3 is no longer valid. Python2 works fine. But there’s a space in between, and in python2 the printed result is: ABC xyz
Read More:
- sbatch: error: instead of expected UNIX line breaks (\n).
- Three ways of single line and multi line comment in Python
- Use Python to insert the specified content in the specified line of the specified file
- Print regularly to activate the printer (for some printers that need to be activated to print)
- The python version output from the command line is inconsistent with the python version in the current CONDA environment
- Missing parents in call to ‘print’
- Tensorflow in function tf.Print Method of outputting intermediate value
- There was an internal error, and Internet Explorer is unable to print this document
- WordPress: How to Remove the directory name in the link
- Python3 reports an error [errno 5] input / output error. Print is used when there is no stdout
- Three methods of how to remove the flashback of running result box in VS
- Python: print syntax error: problem with invalid syntax error
- Cannot remove entries from nonexistent file /usr/local/bin/anaconda2/lib/python2.7/site-packages/eas
- Hide print button when printing page in front end
- Solve the problem of unable to locate package python3.6 when upgrading from python3.5 to python3.6 in ubantu16.04
- How to remove the message “Membership credential verification failed.” displayed in the Event Log
- Solve the problem of using logback console to print log Chinese characters in IDEA as garbled characters
- How to print how to output Int64_ t,uint64_ The value of T in C
- How to empty a whole line in latex (simple and effective)
- Remove spaces after characters in Excel cells