diff --git a/Quick_sort.py b/Quick_sort.py new file mode 100644 index 0000000..96087c1 --- /dev/null +++ b/Quick_sort.py @@ -0,0 +1,25 @@ + +import sys +A=[] +g = int(input("Enter number of elements : ")) + +for i in range(0, g): + ele = int(input()) + + A.append(ele) +print(A) + +for i in range(len(A)): + + + min_idx = i + for j in range(i+1, len(A)): + if A[min_idx] > A[j]: + min_idx = j + + A[i], A[min_idx] = A[min_idx], A[i] + + +print ("Sorted array") +for i in range(len(A)): + print("%d" %A[i]), \ No newline at end of file diff --git a/random password generator.py b/random password generator.py new file mode 100644 index 0000000..708cd34 --- /dev/null +++ b/random password generator.py @@ -0,0 +1,22 @@ +import random +import string + +x=int(input("Enter the length of the password (minimum 4)")) +x=x-4 +def get_random_password(): + random_source = string.ascii_letters + string.digits + string.punctuation + password = random.choice(string.ascii_lowercase) + password += random.choice(string.ascii_uppercase) + password += random.choice(string.digits) + password += random.choice(string.punctuation) + + for i in range(x): + password += random.choice(random_source) + + password_list = list(password) + random.SystemRandom().shuffle(password_list) + password = ''.join(password_list) + return password + +print("First Random Password is ", get_random_password()) +print("Second Random Password is ", get_random_password())