Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def func(file):
- f = open(file, 'r')
- even = 0
- odd = 0
- for line in f:
- if int(line) % 2:
- odd += 1
- else:
- even += 1
- if even > odd:
- print('even')
- elif odd > even:
- print('odd')
- else:
- print('same')
- f.close()
- file = 'numbers.txt'
- func(file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement