I want to do something pretty simple, but I don not know why it is not working
N = int(input())
numbers = list(input())
print(numbers)
def switch(x):
return {
'1': 2,
'2': 5,
'3': 5,
'4': 4,
'5': 5,
'6': 6,
'7': 3,
'8': 7,
'9': 6,
}[x]
print(list(map(switch, numbers)))
I have the above code and what I want is to based in a number sum all of the results for each of its digits from a function called switch