converting strings to numbers

Emile van Sebille emile at fenx.com
Mon Jun 24 06:39:09 EDT 2002


Tony Cradwick
> How do you convert (cast?) a string, eg from a user input entry box,
to a
> number, eg integer?
>

int(raw_input('Enter an integer: '))
float(raw_input('Enter a float: '))

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list