Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. def linsearch(list_of_text, elem):
  2. if elem in list_of_text: True
  3.  
  4.  
  5. def couple(list_of_text):
  6. while True:
  7. elem = input("Your word: ")
  8. if elem == "":
  9. break
  10. linsearch(list_of_text,elem)
  11. for word in range(len(list_of_text)):
  12. if sorted(elem) == sorted(list_of_text[word]):
  13. if elem != list_of_text[word]:
  14. print("{",elem,",", list_of_text[word],"}")
  15.  
  16.  
  17. def main():
  18. list_of_text = open("ordlista.txt").read().split()
  19. couple(list_of_text)
  20.  
  21. if __name__ == '__main__':
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement