Ken Kam wrote:
> I tried to get user input by using scanf
> 
> a = scanf('%d')
> 
> that works, it's all very nice, until i do this
> 
> while a < 100
> and a is an array, so i can't do that.
> 
> So i did this
> while a[0] < 100...
> 
> which works... but is there a better way of doing it?

These should all work:

   a, = scanf('%d')
   a,* = scanf('%d')    # Prettier
   a = *scanf('%d')     # Clearer?

However, if you really just want to convert a single
string to an integer, use str.to_i or Integer(str).


Hal