(newbie)list conversion problem
bdesth.nospam at removeme.free.fr
Thu Jun 19 21:10:54 CEST 2003
Boris Genz wrote:
> Ok, I know this problems proabably make you laugh, but I'm in learning
> I want to translate list of strings into identical list of integers. To
> clear things up, here is an example:
> I want this list: ['7659', '33', '454', '445'] to change in something
> like this: [7659, 33, 454, 445].
> I'm sure this is possible,
> and here is what I tried:
> x = ['7659', '33', '454', '445']
> for elements in x:
> group = 
Here you rebind 'group' to an empty list in each turn of the loop...
> and I got gibberish:)
I guess you have something like group =>  ?
> I'm obviously doing something wrong. Can you help
> me please, I appreciate any help...
Have you tried :
group = [int(item) for item in x]
More information about the Python-list