On Thu, Apr 27, 2006 at 02:48:46AM -0700, [EMAIL PROTECTED] wrote:
> why the output of this code :
> x = 0
> while x < 10:
> z = 0
> print x
> x = x + 1
> while z < x:
> print z,
> z = z + 1
>
> is
>
> 0
> 0 1
> 0 1 2
> 0 1 2 3
> 0 1
Dan Sommers wrote:
> On 27 Apr 2006 02:48:46 -0700,
> [EMAIL PROTECTED] wrote:
>
> > why the output of this code :
> > x = 0
> > while x < 10:
> > z = 0
> > print x
> > x = x + 1
> > while z < x:
> > print z,
> > z = z + 1
>
> > is
>
try something like this:
x = 0
while x < 10:
z = 0
print '-' + str(x) + '-'
x = x + 1
while z < x:
print '.' + str(z) + '.',
z = z + 1
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> why the output of this code :
> x = 0
> while x < 10:
> z = 0
> print x
> x = x + 1
> while z < x:
> print z,
> z = z + 1
>
> is
>
> 0
> 0 1
> 0 1 2
> 0 1 2 3
> 0 1 2 3 4
> 0 1 2 3 4 5
> 0 1 2 3 4 5 6
> 0 1
[EMAIL PROTECTED] wrote:
> why the output of this code :
> x = 0
> while x < 10:
> z = 0
> print x
> x = x + 1
> while z < x:
> print z,
> z = z + 1
>
> is
>
> 0
> 0 1
> 0 1 2
> 0 1 2 3
> 0 1 2 3 4
> 0 1 2 3 4 5
> 0 1 2 3 4 5 6
> 0
On 27 Apr 2006 02:48:46 -0700,
[EMAIL PROTECTED] wrote:
> why the output of this code :
> x = 0
> while x < 10:
> z = 0
> print x
> x = x + 1
> while z < x:
> print z,
> z = z + 1
> is
> 0
Okay, that was x, from the print statement
why the output of this code :
x = 0
while x < 10:
z = 0
print x
x = x + 1
while z < x:
print z,
z = z + 1
is
0
0 1
0 1 2
0 1 2 3
0 1 2 3 4
0 1 2 3 4 5
0 1 2 3 4 5 6
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6