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
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
Danny wrote:
snip
As a shortcut:
print text*5
--- Heiko.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
13 matches
Mail list logo