Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- file = open("Żywiec.txt")
- file2 = open("Żur śląski.txt")
- fil = file.read()
- text = file.read().lower().split()
- text2 = file2.read().lower().split()
- #used english words cause these files consist of only english words
- word1 = "and"
- word2 = "why"
- word3 = "never"
- word4 = "or"
- print(text)
- print(text2)
- print('\n')
- for word in text:
- if word == word1:
- text.remove(word1)
- if word == word2:
- text.remove(word2)
- if word == word3:
- text.remove(word3)
- if word == word4:
- text.remove(word4)
- for word in text2:
- if word == word1:
- text2.remove(word1)
- if word == word2:
- text2.remove(word2)
- if word == word3:
- text2.remove(word3)
- if word == word4:
- text2.remove(word4)
- print(text)
- print(text2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement