Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9dae0ab

Browse files
committed
powerful-password-generator
1 parent 224ec8a commit 9dae0ab

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#Powerful Password Generator Project
2+
import random
3+
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
4+
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
5+
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
6+
7+
print("Welcome to the Password Generator!")
8+
nr_letters = int(input("How many letters would you like in your password?\n"))
9+
nr_symbols = int(input(f"How many symbols would you like?\n"))
10+
nr_numbers = int(input(f"How many numbers would you like?\n"))
11+
12+
password_list = []
13+
14+
for char in range(1, nr_letters + 1):
15+
password_list.append(random.choice(letters))
16+
17+
for char in range(1, nr_symbols + 1):
18+
password_list += random.choice(symbols)
19+
20+
for char in range(1, nr_numbers + 1):
21+
password_list += random.choice(numbers)
22+
23+
print(password_list)
24+
random.shuffle(password_list)
25+
print(password_list)
26+
27+
password = ""
28+
for char in password_list:
29+
password += char
30+
31+
print(f"Your password is: {password}")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /