| | |
how do i go onto a new line in python
![]() |
The newline character in python is '\n'.
or for python 3:
The print statement in python (except python 3) automatically adds a newline at the end.
python Syntax (Toggle Plain Text)
print "Hello\nGoodbye"
python Syntax (Toggle Plain Text)
print("Hello\nGoodbye")
The print statement in python (except python 3) automatically adds a newline at the end.
•
•
•
•
The print statement in python (except python 3) automatically adds a newline at the end.
Python Syntax (Toggle Plain Text)
print "Hello World",

Chris
Last edited by Freaky_Chris; Feb 8th, 2009 at 5:20 pm.
Knowledge is power -- But experience is everything
•
•
•
•
The print statement in python (except python 3) automatically adds a newline at the end.
print - sep = ' ', end = '\n', file = sys.stdout
So that seems to point towards print actually adding a new line to the end.
Also if you do not want this then just go
python Syntax (Toggle Plain Text)
print ("Hello there", end = '')
Last edited by Paul Thompson; Feb 8th, 2009 at 6:16 pm.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Check out my Site | and join us on IRC | Python Specific IRC
![]() |
Similar Threads
- Starting Python (Python)
- Print line number (Python)
- Edit printed line (Python)
- Reloading a Python Script? (Python)
- How to run a Python script directly? (Python)
- get posted form data in python (Python)
- Returning a correct python list (Python)
Other Threads in the Python Forum
- Previous Thread: Parameters and Return Values
- Next Thread: A+ Study tool in python
| Thread Tools | Search this Thread |
alarm app beginner cipher cmd coordinates cx-freeze data decimals development dictionary directory dynamic error examples feet file float format function generator getvalue gui halp homework http images import input ip itunes java keycontrol leftmouse line linux list lists loop maintain maze millimeter module mouse mysqldb number numbers output parsing path port prime programming projects push py2exe pygame pyglet pymailer pyqt python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation split sqlite ssh string strings sudokusolver table terminal text thread threading time tlapse tuple tutorial ubuntu unicode url urllib urllib2 variable variables ventrilo verify vigenere web webservice wikipedia wx.wizard wxpython xlwt






