Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alpha = 'abcdefghijklmnopqrstuvwxyz'
- Alpha = alpha.upper()
- s = input()
- n = 0
- IN = False
- counter = 0
- for c in s:
- if c in alpha+Alpha:
- if IN:
- counter += 1
- else:
- IN = True
- counter = 1
- else:
- if IN:
- IN = False
- n = max(n, counter)
- res = ''
- for c in s:
- if c in alpha:
- res += alpha[(alpha.index(c) + n) % len(alpha)]
- elif c in Alpha:
- res += Alpha[(Alpha.index(c) + n) % len(Alpha)]
- else:
- res += c
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement