+ 1
why was it no input in this password checker
hi guys i have a problem with my code It's harder to solve because i have tried to debugging and it's still return none passinput=input() desc=len(passinput) char=['!', '@', '#', '
#x27;, '%', '&', '*'] number="1234567890" def char1(passinput ): x=0 for alp in char : if passinput in alp: x+=1 else: x return x def nu(passinput ): f=0 for alp in char : if passinput in alp: f+=1 else: f return f def leno(passinput ): return len(passinput) while passinput!= None: passnope=0 if nu(passinput )>=2: passnope+=0 elif not nu(passinput )>=2: passnope+=1 if char1(passinput )>=2: passnope+=0 elif not char1(passinput )>=2: passnope+=1 elif leno(passinput )>=7: passnope+=0 elif not len()>=7: passnope+=1 if passnope==3: print('Weak') elif passnope==0: print('Strong')3 ответов
+ 1
Could you please provide the program itself? It makes debugging so much easier.
0
The first error I noticed was that the functions didn't use the global list char. So you need to inform each function you are using a global list char so that errors don't occur.
Secondly, it seems as if char1() and nu() are the same function. So you can delete one of those functions. In addition, both functions are incorrect. When looping through the char list, if you put a return statement in the else statement, it'll return a 0. Why? Because you're checking an entire input string against one special character one at a time. There is a no way x will be more than 0, unless you i input one special character. So that's another error to fix.
Once you fix these two, I'll try and search for some other errors.