I'm having trouble coding this. I'm learning swift via develop with swift by Apple, and when I try to code this, it stop at "Please add a digit." Can someone explain what I'm doing wrong? Thanks!
let tenMostCommonPasswords = [
"123456",
"password",
"12345678",
"qwerty",
"12345",
"123456789",
"letmein",
"1234567",
"football",
"iloveyou"
]
let digits = "0123456789"
let punctuation = "!@#$%^&*(),.<>;'`~[]{}\|/?_-+= "
let password = "Pasword12!"
for _ in tenMostCommonPasswords{
if tenMostCommonPasswords.contains(password){
print("Please change your password")
}
else{
for _ in digits{
if digits.contains(password){
for _ in punctuation{
if punctuation.contains(password){
print("You're good to go!")
}
else{
print("Please add a punctuation")
}
}
}
else{
print("Please add a digit.")
}
}
}
}