Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line = input().split(", ")
- for i in range(len(line)):
- line[i] = line[i].strip()
- uni = "@#$^"
- for word in line:
- symbol = sorted(word, key=lambda s: word.count(s))[-1]
- if not len(word) == 20:
- print("invalid ticket")
- continue
- elif len(word) == 20:
- if symbol not in uni:
- print(f'ticket "{word}" - no match')
- continue
- elif symbol in uni and word.count(symbol) >= 12:
- left_side = word[:10]
- right_side = word[10:]
- if word.count(symbol) == 20:
- print(f'ticket "{word}" - 10{symbol} Jackpot!')
- continue
- elif symbol * 6 in left_side and symbol * 6 in right_side:
- min_count = min(left_side.count(symbol), right_side.count(symbol))
- print(f'ticket "{word}" - {min_count}{symbol}')
- else:
- print(f'ticket "{word}" - no match')
- else:
- print(f'ticket "{word}" - no match')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement