0
pls friends how do I change letters to desired numbers. am just a beginner help out🙏
i am working on a translation program and i need to change some letters to numbers of my choice
1 Antwort
+ 4
Which language?
In Python you can use dictionary:
nums = {'a': 5, 'b' : 6, 'c' : 7}
s = "nabsc"
for c in s:
print(nums.get(c, c), end="")
output will be n56s7
In c++ you can use map.