Oi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
377 B

  1. namesStations = []
  2. completeList = []
  3. with open('listeBhfe') as doc:
  4. for line in doc:
  5. completeList.append(line.split())
  6. for array in completeList:
  7. if array[-1][0] == '(' and array[-1][-1] == ')':
  8. namesStations.append(array)
  9. namesList = []
  10. for namearray in namesStations:
  11. if len(namearray) < 4:
  12. namesList.append(' '.join(namearray[0:-1]))
  13. print(namesList)