while loop

Michael Torrie torriem at gmail.com
Tue Oct 11 14:31:05 EDT 2016


On 10/11/2016 11:58 AM, dhawanpawan32 at gmail.com wrote:
> 
> n=6
> x=1
> while x<=n:
>     print "*"*x
>     x+=1
> while n>=x:
>     n=n-1
>     print "*"* n
> 
>   
> Only first loop is executing not the second one?

Did you try printing out the loop variable to see what it does and what
it is after the loop is finished?




More information about the Python-list mailing list