Python Forum
Program regarding Password check need assistance
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program regarding Password check need assistance
#1
import re
import random
points = 0
print("""
Point System:
~1 Uppercase Letter = 5 Points
~1 Lowercase Letter = 5 Points
~1 From 0-9 = 5 Points
~1 Allocated Symbol = 5 Points
~If Has All Add 10 Points
""")


while points < 35:
p = input("Input Password: ")


if 8 <= len(p) < 24 :
print(len(p),"Points Added - Length")
points += (len(p))

else:
print("Wrong length, it must be 8 to 24 characters")
continue

if re.search("[a-z]", p):
print("5 Points Added - Lowercase Letter")
points += 5

if re.search("[0-9]", p):
print("5 Points Added - Number")
points += 5

if re.search("[A-Z]", p):
print("5 Points Added - Uppercase Letter")
points += 5

if re.search("[!$%^&()_]", p):
print("5 Points Added - Symbols")
points += 5

if points == 20:
points += 10

print("You have {} points".format(points))
break
okay so the point system of my program works however i am trying to implement a validation system where if the user enters a password and that password doesn't contain all the characters allocated e.g Uppercase,Lowercase,Number or symbol it doesn't show the points it just says try again until they put all of it
Reply
#2
In this fragment, the value 8 isn't assigned to anything:
if 8 <= len(p) < 24 :
print(len(p),"Points Added - Length")
points += (len(p))
Oops just ignore the message my fault :(
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if specific program is used alex_laco 3 2,443 Feb-23-2022, 05:09 PM
Last Post: ndc85430
  What do i have to type in the IDLE shell to use this password manager program? MaartenRo 4 2,946 Jan-15-2022, 02:01 PM
Last Post: MaartenRo
  Check password from sqlite db Maryan 0 1,613 Oct-12-2020, 02:37 PM
Last Post: Maryan
  Beginner python password program jakobscheffler 4 6,103 Jan-23-2019, 08:14 PM
Last Post: Alfalfa
  Password Saver Program suitec 1 5,357 Aug-18-2017, 03:58 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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