Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #takes in txt
  2. #Prints out names in alphabetical order
  3. #prints out the countries that person has been to in alphabetical order
  4. #prints out the name of the person that has traveled to most countries
  5.  
  6. def open_file():
  7. file_stream = open(filename, "r")
  8. return file_stream
  9.  
  10. def split_up(file_stream):
  11. words = []
  12. names = file_stream.strip().split(" ")
  13. for word in names:
  14. words.append(word)
  15. return names
  16.  
  17.  
  18. filename = input("Enter filename: ")
  19. file_stream = open_file()
  20. names = split_up(file_stream)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement