Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('24 (1).txt') as f:
- a = f.readline()
- a = list(map(lambda x: x[2],filter(lambda x: x[0] == x[1], zip(a, a[1:], a[2:]))))
- b = ''.join(sorted(a))
- b = b.replace('AB', 'A B').replace('BC', 'B C').replace('CD', 'C D').replace('DE', 'D E').replace('EF', 'E F')\
- .replace('FG', 'F G').replace('GH', 'G H').replace('HI', 'H I').replace('IJ', 'I J').replace('JK', 'J K')\
- .replace('KL', 'K L').replace('LM', 'L M').replace('MN', 'M N').replace('NO', 'N O').replace('OP', 'O P')\
- .replace('PQ', 'P Q').replace('QR', 'Q R').replace('RS', 'R S').replace('ST', 'S T').replace('TU', 'T U')\
- .replace('UV', 'U V').replace('VW', 'V W').replace('WX', 'W X').replace('XY', 'X Y').replace('YZ', 'Y Z')
- symb = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
- num = list(map(len, b.split()))
- print(symb[num.index(max(num))])
Advertisement
Add Comment
Please, Sign In to add comment