feat: Initial commit

This commit is contained in:
2024-03-22 17:01:42 +01:00
parent 954985f39a
commit c343ff6e93
106 changed files with 143428 additions and 1 deletions

36
generatorePassword.py Normal file
View File

@@ -0,0 +1,36 @@
from random import randint
from string import ascii_letters, digits
spChars = "+-*/?!"
def insert(string, char, index):
return string[0:index] + char + string[index+1:len(string)]
def randomCharFromArray(array):
return array[randint(0,len(array)-1)]
def makePassword(length):
password = ""
for _ in range(length):
password += randomCharFromArray(ascii_letters)
randIndex1 = randint(0,len(password)-1)
password = insert(password, randomCharFromArray(digits), randIndex1) #[randIndex1] = randomCharFromArray(digits)
randIndex2 = randint(0,len(password)-2)
if randIndex1 == randIndex2:
randIndex2 = len(password) - 1
password = insert(password, randomCharFromArray(spChars), randIndex2)
return password
def main():
length = int(input("Insert password length"))
print("Your password is", makePassword(length))
main()