dictionary = {"a": "b", "b": "c", "c": "d", "d": "e", "e": "f", "f": "g", "g": "h", "h": "i", "i": "j", "j": "k", "k": "l", "l": "m", "m": "n", "n": "o", "o": "p", "p": "q", "q": "r", "r": "s", "s": "t", "t": "u", "u": "v", "v": "w", "w": "x", "x": "y", "y": "z", "z" : "a", " ":" "}
password = "h knud xnt"
def decode(dictionary, password):
word = tuple(str(password))
for word in dictionary.keys():
ans = dictionary[word]
return ans
print(decode(dictionary,password))
password 키값을 넣어 딕셔너리의 벨류값 ans를 내보내는 def 함수를 정의하려하는데 초보다 보니 너무 어렵네요.. 위 코드 중 word 부분을 수정해야하는데 힌트좀 부탁드립니다.