Menu

(Solved) : 420 Programming Assignment 2 Problem 2 Problem 2 Passphrase Check 40 Points Trying Make Su Q44103447 . . .

4.20 Programming Assignment 2 - Problem 2 Problem 2 - Passphrase Check (40 points) We are trying to make sure your passphrase

4.20 Programming Assignment 2 – Problem 2 Problem 2 – Passphrase Check (40 points) We are trying to make sure your passphrase is acceptable! Write a script that asks for an input string that will be used as your password. This input string will have three “words” separated by a space character. Each of these words has specific requirements, listed below. You must write a function for each requirement (three total functions). Make sure your functions follow the original template that provided. First Function: For the first word, you must check if it is a palindrome (it is the same forward and backward, like “glolg” or “tacocat”), is case-insensitive (so “GfraaRFg” or “Vobov” are valid), and only uses alphabetical letters (“tre3ert” and “fah, @ @h^f” are not valid). Second Function: For the second word, you must check if it is a positive integer with at least 4 digits, containing only numeric characters (i.e. no alphabetic, punctuation, or special characters). Third Function: For the third word, you must check if it starts with one of these special characters (“@”, “$”, “%”, “^”, “&”), ends with a punctuation mark (only commas (“), periods (“:”), exclamation marks (!”) and question marks (“?”) are allowed), and has three letters in between the special character and punctuation mark (e.g. “@dog!” or “Stpb?” or “Acat,”). If the entire password meets all the correct specifications, then print “valid”, otherwise, print “invalid”. Template Functions (DO NOT CHANGE FUNCTION NAMES): def palindrome (): def integer(): def special(): Show transcribed image text 4.20 Programming Assignment 2 – Problem 2 Problem 2 – Passphrase Check (40 points) We are trying to make sure your passphrase is acceptable! Write a script that asks for an input string that will be used as your password. This input string will have three “words” separated by a space character. Each of these words has specific requirements, listed below. You must write a function for each requirement (three total functions). Make sure your functions follow the original template that provided. First Function: For the first word, you must check if it is a palindrome (it is the same forward and backward, like “glolg” or “tacocat”), is case-insensitive (so “GfraaRFg” or “Vobov” are valid), and only uses alphabetical letters (“tre3ert” and “fah, @ @h^f” are not valid). Second Function: For the second word, you must check if it is a positive integer with at least 4 digits, containing only numeric characters (i.e. no alphabetic, punctuation, or special characters). Third Function: For the third word, you must check if it starts with one of these special characters (“@”, “$”, “%”, “^”, “&”), ends with a punctuation mark (only commas (“), periods (“:”), exclamation marks (!”) and question marks (“?”) are allowed), and has three letters in between the special character and punctuation mark (e.g. “@dog!” or “Stpb?” or “Acat,”). If the entire password meets all the correct specifications, then print “valid”, otherwise, print “invalid”. Template Functions (DO NOT CHANGE FUNCTION NAMES): def palindrome (): def integer(): def special():

Expert Answer


Answer to 4.20 Programming Assignment 2 – Problem 2 Problem 2 – Passphrase Check (40 points) We are trying to make sure your passp…

OR