Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- def check(word_first):
- global word_second
- global data
- if all(symbol in word_second for symbol in word_first):
- data.remove(word_first)
- return word_first.lower()
- file_input = open("input.txt", "r")
- file_output = open("output.txt", "w")
- next(file_input)
- data = [i.strip().lower() for i in file_input]
- for i in range(len(data)):
- word_second = data[0].lower()
- print(*[data[0]] + list(filter(check, data[1:])), file=file_output)
- data.pop(0)
- if not data:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement