Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. ['14th_century;15th_century;16th_century;Pacific_Ocean;Atlantic_Ocean;Accra;Africa;Atlantic_slave_trade;African_slave_trade']
  2.  
  3. for line in loops:
  4.  
  5. links = []
  6. for line in newPath:
  7. links.append(line[3:4])
  8.  
  9. old_list = []
  10. new_list = []
  11.  
  12. old_list = links
  13. new_list = old_list[0].split(';')
  14.  
  15. print new_list
  16.  
  17. my_list = old_list[0].split(';')
  18.  
  19. >>> old_list = ['14th_century;15th_century;16th_century;Pacific_Ocean;Atlantic_Ocean;Accra;Africa;Atlantic_slave_trade;African_slave_trade']
  20.  
  21. >>> my_list = old_list[0].split(';')
  22. ['14th_century', '15th_century', '16th_century', 'Pacific_Ocean', 'Atlantic_Ocean', 'Accra', 'Africa', 'Atlantic_slave_trade', 'African_slave_trade']
  23.  
  24. paths = ['abc;def;ghi', 'jkl;mno;pqr']
  25. paths = [path.split(';') for path in paths]
  26. >>> paths
  27. [['abc', 'def', 'ghi'], ['jkl', 'mno', 'pqr']]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement