Question

PYTHON CODE ONLY PLEASE, AND COMMENT IN SCRIPT TO SHOW STEPS (post copy-ready text code, and also a screenshot of code running)

You work for an on-line game site. Your job is to develop a program that accepts a user name and password. Write a Python scr

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import re

name=input('Enter the user name \n')
password=input('Enter password\n')


flag = 0
i=1
while i==1:
if (len(password)<6): # to check minimum length
flag = -1
break
elif not re.search("[a-z]", password): # to check small letters
flag = -1
break
elif not re.search("[A-Z]", password): # to check capital letters
flag = -1
break
elif not re.search("[0-9]", password): # to check digits
flag = -1
break
elif not re.search("[$#@]", password): # to check #@$
flag = -1
break
elif len(password)>16: # to check maximum length
flag = -1
break
else:
i=2
flag = 0
print("The given Password is Valid Password")

  
if flag ==-1:
print("The given password is Not a Valid Password")
  
  
list=[]
list.append(password)

Output: for password abC#1ed

Sardar Vallabl bhai Na Prime Video Y tra e x e Computer cience que × IDE Geek forGe s aG Python string length 。Strings and Ch

Add a comment
Know the answer?
Add Answer to:
PYTHON CODE ONLY PLEASE, AND COMMENT IN SCRIPT TO SHOW STEPS (post copy-ready text code, and also...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please make this Python code execute properly. User needs to create a password with at least...

    Please make this Python code execute properly. User needs to create a password with at least one digit, one uppercase, one lowercase, one symbol (see code), and the password has to be atleast 8 characters long. try1me is the example I used, but I couldn't get the program to execute properly. PLEASE INDENT PROPERLY. def policy(password): digit = 0 upper = 0 lower = 0 symbol = 0 length = 0 for i in range(0, len(password)): if password[i].isdigit(): # checks...

  • In python Exercise 4 (graded) Write a function "passValidate" that takes a string "s" and checks...

    In python Exercise 4 (graded) Write a function "passValidate" that takes a string "s" and checks the validity of string as a password Validation Rules: At least 1 lowercase letter between [a-z] and 1 upper case letter between [A-Z]. At least 1 number between [0-9 At least 1 character from [$#@]. Minimum length 6 characters. Maximum length 16 characters. CS103-Lab 13 Page 3 of 3 Sample Input: s"Uab@2762" Sample Output: True

  • Write a program that inputs a string from the user representing a password, and checks its...

    Write a program that inputs a string from the user representing a password, and checks its validity. A valid password must contain: -At least 1 lowercase letter (between 'a' and 'z') and 1 uppercase letter (between 'A' and 'Z'). -At least 1 digit (between '0' and '9' and not between 0 and 9). At least 1 special character (hint: use an else to count all the characters that are not letters or digits). -A minimum length 6 characters. -No spaces...

  • Create a python code named LetterCount with a text file named words.txt that contains at least...

    Create a python code named LetterCount with a text file named words.txt that contains at least 100 words in any format - some words on the same line, some alone (this program involves no writing so you should not be erasing this file). Then create a program in the main.py that prompts the user for a file name then iterates through all the letters in words.txt, counting the frequency of each letter, and then printing those numbers at the end...

  • Write a Python function fun8(k) that gets list of strings k as passwords and returns the...

    Write a Python function fun8(k) that gets list of strings k as passwords and returns the valid passwords in list format. Criteria for checking passwords: 1.) At least 1 letter between [a-z] 2.) At least 1 letter between [A-Z] 3.) At least 1 number between [0-9] 4.) At least 1 character from [$#@] 5.) Minimum length of transaction password: 6 6.) Maximum length of transaction password: 12 7.) No spaces Example: >>>lst=["ABd1234@1", "a F1#,2w3E*", "2We3345"] >>>fun8(lst) [ABd1234@1] *****We are a...

  • 1. Write a C++ program called Password that handles encrypting a password. 2. The program must...

    1. Write a C++ program called Password that handles encrypting a password. 2. The program must perform encryption as follows: a. main method i. Ask the user for a password. ii. Sends the password to a boolean function called isValidPassword to check validity. 1. Returns true if password is at least 8 characters long 2. Returns false if it is not at least 8 characters long iii. If isValidPassword functions returns false 1. Print the following error message “The password...

  • Create a python script to manage a user list that can be modified and saved to...

    Create a python script to manage a user list that can be modified and saved to a text file. Input text file consisting of pairs of usernames and passwords, separated by a colon (:) without any spaces User choice: (‘n’-new user account, ‘e’-edit existing user account, ‘d’- delete existing user account, ‘l’- list user accounts, ‘q’-quit) List of user accounts, error messages when appropriate Output text file consisting of pairs of username and passwords, separated by a colon (:) without...

  • please write psedocodes for all of the questions and an algorithm for 2. no coding is...

    please write psedocodes for all of the questions and an algorithm for 2. no coding is required . FIUJELI 95 PIOL 1. (Geometry: Area of a Pentagon) Write a C# program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing the area of a pentagon is Area = 2 , where s is the length...

  • I just started working on some code for a password creator. I was doing some testing and I keep g...

    I just started working on some code for a password creator. I was doing some testing and I keep getting this error: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 6 at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47) at java.base/java.lang.String.charAt(String.java:693) at PasswordCreater.check(PasswordCreater.java:56) at Password.main(Password.java:23 In my code I am having the user create a password that is at least 6 characters long, but no more than 16. Also, include at least one lowercase letter, one uppercase letter, one number digit and one special...

  • Please write code using Python. Rubric Assignment Solution Total: 100 pts Program successfully retrieves and validates...

    Please write code using Python. Rubric Assignment Solution Total: 100 pts Program successfully retrieves and validates user input 15 pts Morse Code Function Created 10 pts Function Uses Parameters to get input message 15 pts Function successfully converts passed message to Morse Code and returns the Morse Code equivalent of message 45 pts Program calls Morse Code function and outputs the result of the function (i.e. the actual Morse Code) 15 pts Main Function Requirement Part 2 MUST have a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT