Dictionary I am starting with is:
s={'A' : 'A', 'B' : 'B', 'C' : 'C'}
Dictionary I want to end up with is:
{'A' : 'B', 'B' : 'C', 'C' : 'A'}.
The only thing I know is how to get random letters instead of the one I have on some particular position, but in this problem I have to shift key's values by n=1
.
I have tried to define n
by which values are shifted but I end up with an error.
import string
dictionary = dict.fromkeys(string.ascii_lowercase, 0)
def shift(dictionary,s)
s2=' '
for c in s:
n=ord(c) - 65
n=+=1
n%=26
s2+=chr(n+65)
return s2