I want to create a function that takes an integer (say 234) and returns it as letters (cde).
I have managed to form some code that takes the number and separates it into its numeric components
def toLetter(n):
x = str(n)
for elem in x:
print(elem)
d = {0 : 'a', 1 : 'b', 2 : 'c', 3 : 'd', 4 : 'e', 5 : 'f', 6 : 'g', 7 : 'h', 8 : 'i', 9 : 'j'}
for n in x:
d[n]
toLetter(234)
But I am really struggling with;
- how to map the dictionary onto the number and
- get it to return it as:
cde
rather than
c
d
e
Any help would be greatly appreciated. I am new so this may be trivial but I have come here as last resort.