Linked Questions
64 questions linked to/from How can I print multiple things on the same line, one at a time?
377 votes
22 answers
751k views
Print in one line dynamically [duplicate]
I would like to make several statements that give standard output without seeing newlines in between statements. Specifically, suppose I have: for item in range(1,100): print item The result is: ...
71 votes
5 answers
126k views
How can I suppress the newline after a print statement? [duplicate]
I read that to suppress the newline after a print statement you can put a comma after the text. The example here looks like Python 2. How can it be done in Python 3? For example: for item in [1,2,3,...
1 vote
3 answers
24k views
How to print on the same line in Python [duplicate]
Is it possible to print text on the same line in Python? For instance, instead of having 1 2 3 I would have 1 2 3 Thanks in advance!
3 votes
3 answers
12k views
Put function outputs to a list in Python [duplicate]
The aim of the following program is to convert words in 4 characters from "This" to "T***", I have done the hard part getting that list and len working. The problem is the program outputs the answer ...
6 votes
3 answers
8k views
how to wait and print on the same line python [duplicate]
ok, so I am doing this tiny countdown function in vpython, the way I am doing it now is import time print "5" time.sleep(1) print "4" time.sleep(1) print "3" time.sleep(1) print "2" time.sleep(1) ...
-5 votes
4 answers
4k views
Printing on only one line [duplicate]
I have a program that has to only print data onto one line. What can I do to do this. for i in range(10): print(i) Is it possible to print all of this on one line so it prints 0, erases the line,...
-2 votes
1 answer
5k views
Python print a list of two element in one line in a loop [duplicate]
i have a list as: one = [(1, 2), (3, 4)] for o in one: print o (1, 2) (3, 4) i need to print (1, 2) and (3, 4) in the same line for o in one: print o (1, 2) (3, 4)
1 vote
2 answers
8k views
Print two or more outputs from functions side by side in python [duplicate]
I'm a little new to Python and I was wondering how you would present more than one output side by side if it was part of different functions. So for a simple example: def function1(): print("This ...
1 vote
1 answer
896 views
python 2.7 | carriage return not working [duplicate]
I am trying to use \r to print to the same line in bash (Ubuntu 16.04 terminal) but it doesn't work, as the program still prints frame number in a new line. Here is the code i = 0 while img is not ...
1 vote
5 answers
537 views
How can I print the following horizontally, not vertically [duplicate]
im triying to print horizontally Text="Si ya conoces Colab, echa un vistazo a este vídeo para obtener información sobre las tablas interactivas" List= [31,43,15,5,26,32,6,1,3,62,62,62,62,62,...
2 votes
4 answers
459 views
Python: How to print results from conditions all in one line [duplicate]
I'm new to coding, and I found this exercise problem in a Python practice website. The instructions go like this: "Write a function translate() that will translate a text into "rövarspråket" (Swedish ...
0 votes
2 answers
199 views
How would I print a certain part of a list on the same line, and another part of lists on different lines in python? [duplicate]
For example: list = [1,2,3,4] how would I get this to print something like this: 1 2 3 4
-1 votes
1 answer
471 views
How to print multiple patterns next to each other? [duplicate]
My forest pattern I did print the forest pattern here but i have to print them next to each other instead of printing them in new lines. How can i do that? When i try to add end="" to last ...
-2 votes
1 answer
285 views
How to print output in Single line [duplicate]
I want to know how to print output in a single line I want to print it like: 1234 instead of 1 2 3 4 Code: # n = (get in from user) i=1 while (i<=n): print (i,) i +=1
0 votes
2 answers
213 views
Print random integer and phrase in same line? [duplicate]
Not sure if this is asked before but: How do you print "searching for x" where "x" is a random integer? I have my code below: from random import randint numbers = [] random = ...