|
8 | 8 | smallans=str(input("Are lowercase Alphabets allowed ? (Y/N) : "))
|
9 | 9 | digans=str(input("Are Digits allowed ? (Y/N) : "))
|
10 | 10 | spans=str(input("Are Special Charecters allowed ? (Y/N) : "))
|
| 11 | +rep=input("Way 1 or Way 2? (1/2) : ") |
11 | 12 | capans,smallans,digans,spans=capans.title(),smallans.title(),digans.title(),spans.title()
|
12 | 13 | if capans=='Y':
|
13 | 14 | if smallans=='Y':
|
|
58 | 59 | quit()
|
59 | 60 |
|
60 | 61 | password=""
|
61 | | -random.shuffle(comblis) |
62 | | -for i in range(passlen): |
63 | | - q=random.choice(comblis) |
| 62 | +if rep=='1': |
| 63 | + for i in range(passlen): |
| 64 | + password+=comblis[random.randint(0,len(comblis)] |
| 65 | + |
| 66 | +else: |
64 | 67 | random.shuffle(comblis)
|
65 | | - password=password+q |
| 68 | + for i in range(passlen): |
| 69 | + q=random.choice(comblis) |
| 70 | + random.shuffle(comblis) |
| 71 | + password=password+q |
66 | 72 | print("\nGenerated Password is : ",password)
|
67 | 73 | print()
|
0 commit comments