-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpassword_generator.py
More file actions
30 lines (27 loc) · 810 Bytes
/
Copy pathpassword_generator.py
File metadata and controls
30 lines (27 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Project: Password Generator
Author:Ameya-govindan
Description:
Create a Python program that generates a random password for the user.
Requirements:
1. Ask the user to enter the desired password length.
2. The password should contain a mix of:
- uppercase letters
- lowercase letters
- numbers
- symbols
3. Use Python's random module to generate the password.
4. Display the generated password to the user.
Sample Input:
Enter password length: 10
Sample Output:
Generated Password: A7#kL9@pQ2
"""
import random
print("Password generator")
characters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*"
length=int(input("Enter the password length:"))
password=""
for i in range(length):
password=password+random.choice(characters)
print("Generated Password:",password)