subject
Computers and Technology, 14.11.2019 22:31 bheam12

Python:
the password must have at least 8 characters with at least one lowercase, one uppercase and one digit character. the program should repetitively ask user for a password till the entered password meets the specifications. then the program should ask the user to confirm the password; if it could not be confirmed then the whole process should start from the beginning.

# this program to set a password.

# this function returns true if the string s has

# no lowercase character otherwise returns false.

def nolowercase(s) :

upper_s = s. upper()

if s == upper_s :

return true

else :

return false

# this function returns true if the string s has

# no uppercase character otherwise returns false.

def nouppercase(s) :

lower_s = s. lower()

if s == lower_s :

return true

else :

return false

# this function returns true if the string s has

# no digit character otherwise returns false.

def nodigit(s) :

if s. count("0") > 0 :

return false

elif s. count("1") > 0 :

return false

elif s. count("2") > 0 :

return false

elif s. count("3") > 0 :

return false

elif s. count("4") > 0 :

return false

elif s. count("5") > 0 :

return false

elif s. count("6") > 0 :

return false

elif s. count("7") > 0 :

return false

elif s. count("8") > 0 :

return false

elif s. count("9") > 0 :

return false

else :

return true

# program to set a password.

# the password must have more than 8 characters

# with at least one uppercase, at least one lowercase

# and at least one digit character.

def main() :

print("this program will set your password.")

password_not_set = true

while password_not_set :

password = input("enter a password: ")

while : # complete the condition

print("password not allowed.")

print("must be longer than 8 characters with")

print("at least one lowercase, one uppercase and one digit.\n")

password = input("enter another password: ")

password_confirm = input("reenter to confirm the password.")

if : # complete the condition

print("password did not match, set another password.")

else :

# complete

print("your password has been set.")

main()

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
Write an expression that will cause the following code to print "equal" if the value of sensorreading is "close enough" to targetvalue. otherwise, print "not equal". ex: if targetvalue is 0.3333 and sensorreading is (1.0/3.0), output is:
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
You know the right answer?
Python:
the password must have at least 8 characters with at least one lowercase, one upperc...
Questions
Questions on the website: 13722367