Hi All,
I'm using Windows Vista with Python 2.5. I need the code to check for case sensitive letters and digits, but something isn't right with it.
The code is below:
I'm using Windows Vista with Python 2.5. I need the code to check for case sensitive letters and digits, but something isn't right with it.
The code is below:
Code:
# -*- coding: cp1252 -*-
from easygui import *
accounttype=buttonbox("Would you like to create an account or login?", "Password Storage System Pro", choices=["Login","New Account"])
if accounttype=="Login":
multpasswordbox("Enter Your Account Information", "Login", ["User ID","Password"])
msgbox("Thank you for using Password Storage System Pro, \nPlease Try Again Later.")
if accounttype=="New Account":
newaccount=multpasswordbox("Enter Your Account Information", "New Account", ["User ID","Password"])
confirm=passwordbox("Please Validate Your Password", "Password")
while newaccount[1]==confirm:
msgbox("Thank you for using Password Storage lolSystem Pro")
password=confirm[1]
i=0
cap=0
low=0
dig=0
while i<len(password):
if password[i] >= "A" and password[i] <= "Z":
cap=cap+1
if password[i] >= "a" and password[i] <= "z":
low=low+1
if password[i] >= "0" and password[i] <= "9":
dig=dig+1
i=i-1
if cap>0 and low>0 and dig>0:
print "Thank You for registering"
print cap
print low
print dig
if newaccount[1]!=confirm:
msgbox("Your Passwords did not match. Try again please.")
confirm=passwordbox("Please Validate Your Password", "Password")
password=confirm[1]
i=0
cap=0
low=0
dig=0
while i<len(password):
if password[i] >= "A" and password[i] <= "Z":
cap=cap+1
if password[i] >= "a" and password[i] <= "z":
low=low+1
if password[i] >= "0" and password[i] <= "9":
dig=dig+1
i=i-1
print cap
print low
print dig
Comment