Last active
March 29, 2022 15:32
-
-
Save Ra1d7/bffd41e9bd2c35b569118ffc8508c4dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
long = input('Please enter how long you want your password to be :') | |
withsym = input('Do you want symbols in your password?(Y/N): ') | |
passwd = [] | |
passe='' | |
def dorand(): | |
global passwd | |
if withsym.lower() == 'y': | |
type = random.randint(0, 3) | |
elif withsym.lower() =='n': | |
type = random.randint(0, 2) | |
if type == 0: | |
passwd.append(chr(random.randint(97,122))) | |
elif type == 1: | |
passwd.append(chr(random.randint(65,90))) | |
elif type ==3: | |
passwd.append(chr(random.randint(35,38))) | |
elif type ==2: | |
passwd.append(chr(random.randint(48,57))) | |
for x in range(0,int(long)): | |
dorand() | |
for cher in passwd: | |
passe=passe+str(cher) | |
print('\033[32m{}\033[0m'.format(passe)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment