Question:
Write a python program to generate passwords
Program:
1 2 3 4 5 |
import string from random import * characters = string.ascii_letters + string.punctuation + string.digits password = "".join(choice(characters) for x in range(randint(8, 16))) print (password) |
Explanation:
Following are the criteria for creating a password:
1. At least 1 letter between [a-z]
2. At least 1 number between [0-9]
1. At least 1 letter between [A-Z]
3. At least 1 character from [$#@]
4. Minimum length of transaction password: 6
5. Maximum length of transaction password: 12
Output:
1 |
-|>GR5UZY3 |