Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 389 Bytes

File metadata and controls

26 lines (21 loc) · 389 Bytes

What Did I Learn?

In this challenge I learned about mapping:

  1. Initializing mapping
mapping = {' ': ' '}
  1. Create mapping
i = 0
letters = 'abcdefghijklmnopqrstuvwxyz'

for char in key:
    if char not in mapping:
        mapping[char] = letters[i]
        i += 1
  1. Using mapping
res = ''
for char in message:
    res += mapping[char]