I think it will work if you cast your input to an int:
howmany = int(raw_input( "How many: " ))

On 07/09/2007, matte <[EMAIL PROTECTED]> wrote:
>
> Hi guys
>
> Please excuse me but I've been out of Python for a while since my laptop
> was stolen...
>
> I'm battling with a very basic while loop....
>
> -------------- 8< ----------------------
> #!/usr/bin/python
>
> from random import randint
>
> counter = 0
>
> howmany = raw_input( "How many: " )
>
> while counter < howmany:
>
>     pin = randint(0000,9999)
>     print pin
>     counter += 1
>
> -------------- 8< ----------------------
>
> For some reason if I use an integer in place of "howmany" it works, but
> I'd
> like it to work as I can logically see it above.
>
> What am I missing ?
>
> -m
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>


-- 
Michael Connors
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to