Re: [Tutor] how to separate the digital and the alphabeta

2011-11-03 Thread Dave Angel
On 11/03/2011 12:37 PM, lina wrote: I have another question, regarding the generator, def translate_process(dictionary,tobetranslatedfile): results=[] with open(tobetranslatedfile,"r") as f: results=(dictionary[line.split()[2]] for line in f) print(list(results))

Re: [Tutor] how to separate the digital and the alphabeta

2011-11-03 Thread Dave Angel
On 11/03/2011 12:30 PM, lina wrote: Hi, ['1AB','57GL', '76LE'] How can I extract 1, 57 , 76 out? except the one I tried as: for i in range(len(a)): print(a[i][:-2]) 1 57 76 are there some way to tell the difference between the [0-9] and [A-Z], In the last thread, somebod

Re: [Tutor] how to separate the digital and the alphabeta

2011-11-03 Thread lina
I have another question, regarding the generator, def translate_process(dictionary,tobetranslatedfile): results=[] with open(tobetranslatedfile,"r") as f: results=(dictionary[line.split()[2]] for line in f) print(list(results)) print(len(list(results))) Here the

[Tutor] how to separate the digital and the alphabeta

2011-11-03 Thread lina
Hi, ['1AB','57GL', '76LE'] How can I extract 1, 57 , 76 out? except the one I tried as: >>> for i in range(len(a)): print(a[i][:-2]) 1 57 76 are there some way to tell the difference between the [0-9] and [A-Z], Thanks for the help (you will give and you have given). Best r