-
Notifications
You must be signed in to change notification settings - Fork 0
/
Untitled-1.py
40 lines (19 loc) · 1023 Bytes
/
Untitled-1.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
31
32
33
34
35
36
37
38
39
40
import random
lengeth = int(input( "choose your pasword lengeth: "))
caps = input ("choose if you want caps. y / n :")
numbers = input ("choose if you want numbers. y / n :")
alphabet = ("qwertyuiopasdfghjklzxcvbnm")
allnumbers = ("1234567890")
alphabet_caps = ("QWERTYUIOPASDFGHJKLZXCVBNM")
passwordwithcaps = ''.join(random.sample(alphabet + alphabet_caps , lengeth))
password = ''.join(random.sample(alphabet, lengeth))
passwordwithnumbers = ''.join(random.sample(alphabet + allnumbers, lengeth))
passwordwithcapsandnumbers = ''.join(random.sample(alphabet + alphabet_caps + allnumbers , lengeth))
if caps == "y" and numbers == ("y"):
print ("your password is:",passwordwithcapsandnumbers)
if caps == "y" and numbers == ("f"):
print ("your password is:",passwordwithcaps)
if numbers == "y" and caps == ("n"):
print ("your password is:",passwordwithnumbers)
if caps == "n" and numbers == "n":
print ("your password is:",password)