Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin_with_a = []
- six_letters_long = []
- path_to_animals = 'animals.txt'
- with open(path_to_animals, 'r') as f:
- for line in f.readlines():
- if line.startswith('A'):
- begin_with_a.append(line)
- with open(path_to_animals, 'r') as f:
- for line in f.readlines():
- if len(line) == 7:
- six_letters_long.append(line)
- for i in begin_with_a:
- print(i)
- for i in six_letters_long:
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment