Dec-03-2019, 02:58 PM
First of all, you are using Python 2.7. End of life for Python 2.7 is at the end of the month. You should really upgrade to Python 3.7.
To answer your question, to print without going to the next line in 2.7, you use a trailing comma:
To answer your question, to print without going to the next line in 2.7, you use a trailing comma:
for spam in range(5): print 'spam',In 3.0+, print is a function, and you use the end parameter to specify no new line at the end:
for spam in range(5): print('spam ', end = '')
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures