User8574
Active Coder
Python:
digit_mapping = {
"1" == "One",
"2" == "Two",
"3" == "Three",
"4" == "Four"
}
phone = input("Phone: ")
output = ""
for digits in phone:
output = output + digit_mapping.get(digits, "!") + " "
print(output)
The .get function is shown as an error (btw this is Python 3.10). Why?