Write a Python function that generates a random password which meets the following conditions:
• Length = 10
• At least 2 capital letters, at least 2 small letters and at least 2 numbers.
Example: ZlSyx0gDbX
import random
def generatePassword():
password = ""
capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
smalls = capitals.lower()
numbers = "0123456789"
for i in range(2):
password += capitals[random.randint(0,25)]
password += smalls[random.randint(0, 25)]
password += numbers[random.randint(0, 9)]
for i in range(4):
n = random.randint(0,2)
if(n==0):
password += capitals[random.randint(0, 25)]
elif(n==1):
password += smalls[random.randint(0, 25)]
else:
password += numbers[random.randint(0, 9)]
return password
# Testing
print(generatePassword())
print(generatePassword())

Write a Python function that generates a random password which meets the following conditions: • Length...
Write a function in Java to generate a password and test whether it meets specific complexity criteria. Be creative with how you generate passwords - strong passwords have a mix of at least three of these attributes - lowercase letters, uppercase letters, numbers, and symbols. You can even prompt the user to ask them the strength of the password and adjust what is generated as an enhancement if you like. The passwords should be random, generating a new password every...
Lang: Python Create code that will generate a random password for a user following the constraints below... Password Generator: Must have a length of 20 Must contain 2 lowercase letters Must contain 2 uppercase letters Must contain 2 numbers Must contain 2 valid symbols These symbols are allowed !@#$%^&*()? Chose the characters with replacement
How to write python code that is a dice rolling function that generates random numbers. The dice rolling function takes two arguments: the first argument is the number of sides on the dice and the second argument is the number of dice. The function returns the sum of the random dice rolls. For example, if I call roll dice(6,2) it might return 7, which is the sum of randomly chosen numbers 4 and 3. It somewhere along the lines of:...
Create a Python Program that will ask the user for a password (use input) Verify that the password meets the following conditions: -must be 12 characters long -must have uppercase and lowercase -must contain at least 1 special character (!~#$%^&*{}+_) -must be a mix of numbers and letters You must do this only using regular expressions so for instance this will not be accepted if len(password) <12: At the end of the program tell the user their password is ok...
Create a Python Program that will ask the user for a password (use input) Verify that the password meets the following conditions: -must be 12 characters long -must have uppercase and lowercase -must contain at least 1 special character (!~#$%^&*{}+_) -must be a mix of numbers and letters You must do this only using regular expressions so for instance this will not be accepted if len(password) <12: At the end of the program tell the user their password is ok...
1.Write a PHP function that generates a random email. 2.Write a PHP function that generates a random password given the length as a parameter. 3. Run a query that will generate a database named lab4 b. 4.Run a query that will create a table named users, the table will only have three columns, email TEXT and password TEXT, ID INTEGER NOT NULL AUTO_INCREMENT. ID will be the primary key that will be generated for us automatically based on the record...
8.4 in python
function that checks whether a string is a valid password. Suppose the pas rules are as follows: . A password must have at least eight characters - A password must consist of only letters and digits. ■ A password must contain at least two digits. Write a program that prompts the user to enter a password and displays valid password if the rules are followed or invalid password otherwise (Occurrences of a specified character) Write a function...
I need to write a function that meets the following requirements in Python. Function name: removeTriplicateLetters() Number of parameters: 1 string parameter where all letters are lowercase Return value: return the modified string Goal: Iterate over the string and remove any triplicated letters (e.g. "byeee mmmy friiiennd" becomes "bye my friennd"). You may assume any immediate following same letters are a triplicate.
Write a program in python that generates X random integers Num. Num is a random number between 20 to 50. X is a random number between 10 to 15. Calculate and show the Smallest, Largest, Sum, and Average of those numbers. You are not allowed to use Python functions sample(), min(), max(), average(), sort(), sorted()!! HINTs: to find Smallest.... 1) X is a random number between 10 to 15... for example 11...this determines how many times the loop will happen...
PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv Write a program that generates two random integer numbers between 1 and 100. Then, print out the numbers between the two randomly generated ones using a while loop. The output is shown below. Output: a) start:4, end:14 4 5 6 7 8 9 10 11 12 13 14 b) start:15, end:20 15 16 17 18 19 20