While loop - print several times but on 1 line.
Danny
dannybuck1 at gmail.com
Thu Jan 26 05:08:18 EST 2006
Hello there.
I'm creating a little text changer in Python. In the program there is a
while loop. The problem is that a while loop will have 1 print statement
and it will loop until it gets to the end of the text.
Example:
num = 5 // Set num to 5
while num >= 1: // loop 5 times.
print """text"""
num = num-1
// end.
The programs output will be:
text
text
(etc)
How could I make this print: texttexttexttexttext?
Ive researched and looked through google and so far I can't find
anything that will help (or revelent for that matter).
Thanks for looking.
More information about the Python-list
mailing list