-
Notifications
You must be signed in to change notification settings - Fork 0
/
password.py
30 lines (27 loc) · 891 Bytes
/
password.py
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
#This is a Password Generator.
#Import function
import random
loop = 1
#code start
while True:
many=int(input("How many password do you want to be generated? "))
lenght=int(input("How long password you want? "))
password = ""
pas = ""
for x in range(0, many):
for b in range(0, lenght):
rad = random.randint(0, 4)
if (rad == 1) :
pas = random.choice('abcdefghijklmnopqrstuvwxyz')
elif (rad == 2) :
pas = random.choice('%&#=+')
elif (rad == 3) :
pas = random.choice('1234567890')
elif (rad == 4) :
pas = random.choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
password = password + pas
print (password)
password = ""
close=input("Do you want to generatet more password? Y/n ")
if close != "Y" :
break