My code:
print "*"
print "*"
Output:
*
*
But what I want is:
* *
How can I do it?
My code:
print "*"
print "*"
Output:
*
*
But what I want is:
* *
How can I do it?
Put commas at the end of first print
statement:
print '*',
print '*'
Output:
* *
You can do help('print')
.
To simply avoid adding a newline, do as @LetzerWille instructs; add a comma.
To print the same character/string multiple times on a line, do
print('* ' * 2)