我刚刚开始学习python,我正在尝试创建一个小型蛮力程序,它将要求用户输入(密码),蛮力它然后检查它是否匹配。我的问题:我被困在循环的计算中(正如您将在源代码中看到的那样)
谢谢你的帮助。
源代码:
L1=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
L2=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
L3=['0','1','2','3','4','5','6','7','8','9']
L4=L1+L2+L3
user=input("Enter your secret password here (maximum 4 characters): ")
sum=""
for i in range(0,len(L4)):
sum=L4[i]+L4[i+1]
print(sum)
if sum==user:
print("your cracked password is :", sum)
break;