(newbie)list conversion problem

Boris Genz boris_genz at hotmail.com
Thu Jun 19 15:00:34 CEST 2003


Ok, I know this problems proabably make you laugh, but I'm in learning
process:)
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 = []
  group.append(int(elements))

and I got gibberish:) I'm obviously doing something wrong. Can you help
me please, I appreciate any help...

P.S. My English is poor but I hope you understand me;)




More information about the Python-list mailing list