Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from collections import Counter
- sum = 0
- for file in open('strings.txt'):
- c = Counter()
- strs = file.strip()
- for y in strs:c[y] += 1
- numberofvowels = c['a'] + c['e'] + c['i'] + c['o'] + c['u']
- numberofdigits = c['0'] + c['1'] + c['2'] + c['3'] + c['4'] + c['5'] + c['6'] + c['7'] + c['8'] + c['9']
- if(numberofvowels) % 2 != 0:continue
- if(numberofdigits < 3):continue
- if 'b' in strs or 'q' in strs:continue
- flag = 0
- for x in strs:
- if re.findall('[^0-9a-zA-Z]', x) != []:flag+=1
- if flag > 3:continue
- sum += 1
- print sum
Advertisement
Add Comment
Please, Sign In to add comment