Advertisement
Rnery

Python - findall..

Sep 2nd, 2021 (edited)
244
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | Source Code | 1 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. from re import findall
  5.  
  6. filiais = ['RS_POA',  'PA_BEL',  'PR_CWB',  'SC_CCM',  'RS_RIA',  'ES_SRR',  'MG_BHZ',  'AL_MCZ',  'PB_JPA',  'BA_SSA',  'RN_NAT',  'GO_GYN',  'PE_REC',  'SC_FLN',  'SP_PNM',  'SP_JDI',  'CE_FOR',  'MA_IMP',  'MA_THE',  'PI_THE',  'BA_FEC',  'RJ_RIO',  'MG_UDI',  'DF_BSB',  'TO_PMW',  'GO_BSB',  'MT_CGB',  'MS_CGR',  'AC_RBR']
  7.  
  8. lista_por_estado = []
  9.  
  10. for _ in filiais:
  11.     if findall(r'^BA_', _):
  12.         lista_por_estado.append(_)
  13.         print(lista_por_estado, end = " ", flush = True)
Tags: python python3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement