While loop - print several times but on 1 line.

2006-01-26 Thread Danny
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

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Diez B. Roggisch
Danny wrote: 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

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Heiko Wundram
Danny wrote: snip As a shortcut: print text*5 --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Stefan Neumann
Danny wrote: 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). I am not quite sure, if I simplify the problem but i thought about something like that: print

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Danny
I think I should paste some of the programs code a little more of what I want... var = 0 while var = 5: print a[t[var]] var = var +1 a is a dectionary (very big) and t is a string of text. (if that's important right now). I'm just trying to make the value of a[t[var]] print on one

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Claudio Grondi
Danny wrote: I think I should paste some of the programs code a little more of what I want... var = 0 while var = 5: print a[t[var]] var = var +1 a is a dectionary (very big) and t is a string of text. (if that's important right now). I'm just trying to make the value of

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Danny
Great! It's been solved. The line, as Glaudio said has a , at the end and that makes it go onto one line, thanks so much man! var = 0 while = 5: print a[t[var]], var = var +1 prints perfectly, thanks so much guys. -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Fredrik Lundh
Danny wrote: I think I should paste some of the programs code a little more of what I want... var = 0 while var = 5: print a[t[var]] var = var +1 a is a dectionary (very big) and t is a string of text. (if that's important right now). I'm just trying to make the value of

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Fredrik Lundh
Danny wrote: Great! It's been solved. The line, as Glaudio said has a , at the end and that makes it go onto one line, thanks so much man! var = 0 while = 5: print a[t[var]], var = var +1 prints perfectly, thanks so much guys. if you wanted spaces between the items, why didn't

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Sion Arrowsmith
Danny [EMAIL PROTECTED] wrote: 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). I'm kind of surprised this isn't a FAQ (if it's

Re: While loop - print several times but on 1 line.

2006-01-26 Thread Jeffrey Schwab
Danny wrote: Great! It's been solved. The line, as Glaudio said has a , at the end and that makes it go onto one line, thanks so much man! var = 0 while = 5: print a[t[var]], var = var +1 prints perfectly, thanks so much guys. Looping over indexes is kinda unpythonic in its

Re: While loop - print several times but on 1 line.

2006-01-26 Thread bruno at modulix
Danny wrote: I think I should paste some of the programs code a little more of what I want... probably... var = 0 while var = 5: print a[t[var]] var = var +1 a is a dectionary (very big) and t is a string of text. (if that's important right now). It might be important... I'm

Re: While loop - print several times but on 1 line.

2006-01-26 Thread bruno at modulix
Jeffrey Schwab wrote: Danny wrote: Great! It's been solved. The line, as Glaudio said has a , at the end and that makes it go onto one line, thanks so much man! var = 0 while = 5: print a[t[var]], var = var +1 prints perfectly, thanks so much guys. Looping over indexes