Hi there i'm hoping someone can help me with this little problem. I'm pretty sure its a scope issue but since I'm new to python I cant say for sure.
Basically i'm trying to get the counter2 variables final result. Below is the function as it stands right now, I've tried pretty much everything i can think of so far any help would be really apreciated:
def Numero(name):
alpha = { 'a': 1, 'b': 2, 'c': 3, 'd': 4}
counter1 = 0
counter2 = 0
while counter1 != len(name):
for key, value in alpha.items():
if key in name[counter1]:
counter2 += value
counter1 += 1
return counter2