Question

In: Computer Science

Use the Python programming language to complete below (I need the New Answer for this, and...

Use the Python programming language to complete below (I need the New Answer for this, and please provide the screenshot of the source code. Thank you!):

  • A website requests an user to input his account password.
  • Write a program to examize the validity of the password.
  • The valid password must consists of:
    • At least 1 letter in [a-z]
    • At least 1 number in [0-9]
    • At least a letter in [A-Z] (capital)
    • At least one special letter in [$#@]
    • At least 6 letters in total
    • At most 12 letters in total
  • The program can accept a list of passwords that are split by commas.
  • Print all valid passwords in a line and split by commas
  • Examples:
    • Input: ABd1234@1,a F1#,2w3E*,2We3345
    • Output: ABd1234@1

Solutions

Expert Solution

#python package to find patterns
import re
#inputs comma separated passwords
input_password = str(input("Enter passwords : "))
#append those passwords into a list
password_list = input_password.split(",")
#list to store valid passwords
password_valid=[]
#iterate over all the passwords in the list
for password in password_list:
    #checks all the given conditons
    if(len(password)>6 and len(password)<12):
        if(re.search("[a-z]",password)):
            if(re.search("[A-Z]",password)):
                if(re.search("[0-9]",password)):
                    if(re.search("[$#@]",password)):
                        #if all the conditons are satisfied it will be appended into list
                        password_valid.append(password)
#prints passwords comma separated
print(','.join(map(str,password_valid)))
Enter passwords : ABd1234@1,,a F1#,2w3E*,2We3345,ABd1234@2                                                                                              
ABd1234@1,ABd1234@2                                                                                                               
                                                                                                                                     
                                                                                                                                     
...Program finished with exit code 0         

i hope the answer is clear and satisfactory.

if you have any doubts feel free to ask in comment section

please give me a thumbs up


Related Solutions

Use the Python programming language to complete below (I need the New Answer for this, and...
Use the Python programming language to complete below (I need the New Answer for this, and please provide the screenshot of the source code. Thank you!): Write a function to seek for all even numbers and odd numbers in the middle of two number A and B. Print even and odd numbers in 1 and 2020 (including both these two numbers)
I did the complete programming in python , just want to use tkinter for GUI. please...
I did the complete programming in python , just want to use tkinter for GUI. please look at the 2nd part . i did some part of this program using tkinter but could not finis it. Thank you. import random image = 'w' # modified functions which accepts two numbers each and returns the respective # output def add(a, b): return a + b def subtract(a, b): return a - b def multiply(a, b): return a * b def kidCalc():...
Note: I need a code and other requirement Note: programming language is c++ If you need...
Note: I need a code and other requirement Note: programming language is c++ If you need more information, please clarify what information you want. consider solving the equation sin(x) - e^(-x) = 0 write a computer program to solve the given equation using: 1- bisection method 2- fixed-point method 3- newton's intervals: {0,1},{1,2},{2,3},{3,4},{4,5},{5,6},{6,7},{7,8},{8,9},{9,10} choose accuracy E = 10^(-5) Make sure you document your program Requirement : 1- Mathematical justification 2- algorithem description 3- code (program) with documentation 4-output: roots ,...
I am building a game in C programming language where I need to add objects of...
I am building a game in C programming language where I need to add objects of various length into a game board. The game board is 8X8 and we must account for the boundaries for the board and not go over them with our objects. The boards upper left corner is at 0x0 and we must return 1 if it fits and -1 if it does not fit. I have the following 2 functions to start with: ```int add_object_vert(int r,...
I need assistance with the below HTML5 web programming assignment. Use as many question as you...
I need assistance with the below HTML5 web programming assignment. Use as many question as you need to answer. (c) Client Lab – Exploring Form Design (25 points) The design of a form, such as the justification of the labels, the use of background colors, and even the order of the form elements can either increase or decrease the usability of a form. Visit some of the following resources to explore form design: Because of the dynamics of web sites,...
Please use the Scheme programming language with Dr. Racket to solve a and b below. (Use...
Please use the Scheme programming language with Dr. Racket to solve a and b below. (Use Scheme and not Python) Write before–in–list?, which takes a list and two elements of the list. It should return #t if the second argument appears in the list argument before the third argument: > (before–in–list? '(back in the ussr) 'in 'ussr) #T > (before–in–list? '(back in the ussr) 'the 'back) #F The procedure should also return #f if either of the supposed elements doesn't...
This lab problem demonstrates the use of import module. The Python programming language has many strengths,...
This lab problem demonstrates the use of import module. The Python programming language has many strengths, but one of its best is the availability to use many existing modules for various tasks, and you do not need to be an experienced computer programmer to start using these modules. We have given you some incomplete code; note that the very first line of that code contains an import statement as follows: import math This statement enables your program to use a...
Please I need a new answer for the below questions, Due to the remarkable raise and...
Please I need a new answer for the below questions, Due to the remarkable raise and advancement of technology, lots of large companies are moving forward to digitalize and virtualize how they do business internally and externally, such as virtual teams. Moreover, one of the virtual team advantages is the ability for a company to create the dream team without boundaries as it eliminates the element of desistance, core knowledge and skills limitation. With all these wonderful components there are...
The programming language is Python Instructions: Create a function that will delete a node in a...
The programming language is Python Instructions: Create a function that will delete a node in a Linked List based on position number. On below example, if you want to delete position #2, it will remove the Banana (arrangement of nodes below is Apple, Banana, Cherry, Grapes, Orange). myLinkedList = LinkedList() myLinkedList.append("Banana") myLinkedList.append("Cherry") myLinkedList.append("Grapes") myLinkedList.append("Orange") myLinkedList.prepend("Apple") myLinkedList.deleteByPositionNum(2) node = myLinkedList.head while node: print(node.value, " ") node = node.next_node You may start with the function head: def deleteByPositionNum(self, positionNum):
Programming language Python It have to be in Functions with a main function Samuel is a...
Programming language Python It have to be in Functions with a main function Samuel is a math teacher at Hogwarts School of Witchcraft and Wizardry. He loves to give his students multiplication exercises. However, he doesn’t care about the actual operation result but the unit sum of its digits. At Hogwarts School of Witchcraft and Wizardry, they define the unit sum (US) of N as the unit that it is left after doing the sum of all the digits of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT