Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inp=list(input("Введите строку: ").replace(" ",""))
- statistic = sorted([(i, inp.count(i)) for i in set(inp)], key=lambda x: x[1])
- shift_val = int(input("Введите сдвиг: "))
- shift = [ (chr(i), chr((i+shift_val)) if (i+shift_val<=ord("z")) else chr(ord("a")+(i+shift_val)%ord("z")-1)) for i in range(ord("a"), ord("z")+1)]
- print(statistic)
- print(shift)
- print(list(map(lambda x: (shift[ord(x[0])-ord("a")][1], x[1]), statistic)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement