Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password checking
#5
Quote:re?

I can't do it. Regular expressions are my weakness.


Neah, let's get sadistic:
def check(password):
    test = (str.isdigit, str.isupper, str.islower)
    good_enough = all(any(f(p) for p in password) for f in test)
    return len(password) >= 8 and good_enough
Note: if you try to turn the above into a professor and you don't know basic python they will get very suspicious.
Reply


Messages In This Thread
Password checking - by nzieno - Oct-11-2016, 11:27 PM
RE: Password checking - by wavic - Oct-11-2016, 11:47 PM
RE: Password checking - by Mekire - Oct-12-2016, 03:39 AM
RE: Password checking - by wavic - Oct-12-2016, 03:44 AM
RE: Password checking - by Mekire - Oct-12-2016, 03:49 AM
RE: Password checking - by Skaperen - Oct-15-2016, 03:27 AM
RE: Password checking - by nilamo - Oct-17-2016, 09:14 PM
RE: Password checking - by micseydel - Oct-18-2016, 12:18 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020