- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap_character.py
More file actions
Latest commit
16 lines (12 loc) · 503 Bytes
/
Copy pathmap_character.py
File metadata and controls
16 lines (12 loc) · 503 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
letters="abcdefghijklmnopqrstuvwxyz"
defmap_character(character):
i=next(ifori, letterinenumerate(letters) ifletter==character)
mapped_index=len(letters) -i-1
returnletters[mapped_index]
print("Performing mapping:")
forletterinletters:
print(f"{letter} -> {map_character(letter)}")
characters=input("Input: ")
mapped_characters= [map_character(character) forcharacterincharacters]
output="".join(mapped_characters)
print(f"Output: {output}")