While Statement

Joel Ross joelc at cognyx.com
Fri May 22 12:00:16 CEST 2009


Joel Ross wrote:
> Hi all,
> 
> I have this piece of code
> 
> class progess():
> 
>     def __init__(self, number,  char):
> 
>         total = number
>         percentage = number
>         while percentage > 0 :
>             percentage = int(number/total*100)
>             number-=1
>             char+="*"
>             print char
> 
> progess(999,  "*")
> 
> Just wondering if anyone has any ideas on way the percentage var gets 
> set to the value 0 after the first loop.
> 
> Any feed back would be appreciated.
> 
> Regards
> 
> jross

Thanks for the quick response and the heads up. Makes sense

Thank you. You guys helped me out alot:)



More information about the Python-list mailing list