[Tutor] test

Paolino Gianrossi paolino.gianrossi at gmail.com
Mon Dec 27 14:52:06 CET 2010


Il 27/12/2010 14.44, Chrystal ha scritto:
> Hi guys
> 
> I'll be happy if someone can help evaluate the result of this statement:
> 
>     for n in range (3, 20):
>     for x in range (2, n):
>     print (n)
> 
> 
> I tried but couldn't figure out why the loop returned such a result
> 
> Merry Christmas
> 
> Thanks
>  
> 
What result is so strange for you? I get a perfectly understandable

3
4
4
5
5
5
6
6
6
6
7
7
7
7
7
...
And so on up to 19 repeated 17 times...

cheers
paolino


More information about the Tutor mailing list