Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # keeps lines with char "a"
- # line has '\n' so print doesn't have to add own '\n'
- import fileinput
- for line in fileinput.input('test.txt', 'w'):
- if 'a' in line:
- print(line, end='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement