The purpose here is to find out the passwords, in the same trial and error, and it's all going well while the letters, but when they arrive in the numbers, they repeat for a reason that I do not really understand . If someone can find the error in the code, I'm grateful.
import random
senha='TasLAVa4554'
alfa='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num='123456789'
def breakK(x):
ans=''
for y in senha:
for z in alfa:
if str(y)==str(z):
print('Verificando aspectos...')
ans+=str(z.upper())
if str(y)==str(z.lower()):
print('Verificando aspectos...')
ans+=str(z.lower())
else:
print('Testando...')
for n in num:
if str(y)==str(n):
print('Verificando aspectos')
ans+=str(n)
else:
print('Verificando aspectos')
print(ans)
####
print(breakK(senha))