>>> f=open('/tmp/1.txt','r').readlines()
>>> [a.strip() for a in f if 'pe' in a.lower()]
['Katherine Montolio Perez']
>>> f=open('/tmp/1.txt','r')
>>> f.readlines()
['Ambiorix Rodriguez Placenio\n', 'Ruth Cedeno Lara\n', 'Katherine Montolio Perez\n', 'Armando Rodriguez Rosario\n']
do the magic
>>> f=open('/tmp/1.txt','r')
>>> [a.strip() for a in f.readlines()]
['Ambiorix Rodriguez Placenio', 'Ruth Cedeno Lara', 'Katherine Montolio Perez', 'Armando Rodriguez Rosario']
>>>
>>>
>>> f=open('/tmp/1.txt','r')
>>> [a.strip().upper() for a in f.readlines()]
['AMBIORIX RODRIGUEZ PLACENIO', 'RUTH CEDENO LARA', 'KATHERINE MONTOLIO PEREZ', 'ARMANDO RODRIGUEZ ROSARIO
No hay comentarios:
Publicar un comentario