From bb36f01ed54b98f95e7eb04de7957734a68825b7 Mon Sep 17 00:00:00 2001 From: AndriiVyshnevskyi <125596048+AndriiVyshnevskyi@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:50:56 +0300 Subject: [PATCH 1/3] Update students.txt Vyshnevskyi --- students.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/students.txt b/students.txt index b61091a..a5be3d3 100644 --- a/students.txt +++ b/students.txt @@ -1,2 +1,4 @@ First Name Last Name -Artem Hrechanychenko \ No newline at end of file +Artem Hrechanychenko + +Andrii Vyshnevskyi From 3b75417f76d331f8ae5f3119f64e4ff6db817589 Mon Sep 17 00:00:00 2001 From: AndriiVyshnevskyi <125596048+AndriiVyshnevskyi@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:56:57 +0300 Subject: [PATCH 2/3] Create Calculator --- Calculator | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Calculator diff --git a/Calculator b/Calculator new file mode 100644 index 0000000..3d25d87 --- /dev/null +++ b/Calculator @@ -0,0 +1,40 @@ +def add(x, y): + """Addition""" + return x + y + +def subtract(x, y): + """Subtraction""" + return x - y + +def multiply(x, y): + """multiplication""" + return x * y + +def divide(x, y): + """Division""" + if y != 0: + return x / y + else: + return "Error, divide -0-!" + +print("Choose transaction:") +print("1. Addition") +print("2. Subtraction") +print("3. multiplication") +print("4. Division") + +choice = input("Add number operation (1/2/3/4): ") + +num1 = float(input("Enter first number: ")) +num2 = float(input("Enter second number: ")) + +if choice == '1': + print(num1, "+", num2, "=", add(num1, num2)) +elif choice == '2': + print(num1, "-", num2, "=", subtract(num1, num2)) +elif choice == '3': + print(num1, "*", num2, "=", multiply(num1, num2)) +elif choice == '4': + print(num1, "/", num2, "=", divide(num1, num2)) +else: + print("Incorrect input transaction") From f322b2aecbf107fa16b871db938d885f59755f05 Mon Sep 17 00:00:00 2001 From: AndriiVyshnevskyi <125596048+AndriiVyshnevskyi@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:55:49 +0300 Subject: [PATCH 3/3] Create Password Generator --- Password Generator | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Password Generator diff --git a/Password Generator b/Password Generator new file mode 100644 index 0000000..17fe31f --- /dev/null +++ b/Password Generator @@ -0,0 +1,31 @@ +import random +import string + +def generate_password(length): + # Define character sets for password generation + uppercase_letters = string.ascii_uppercase + lowercase_letters = string.ascii_lowercase + numbers = string.digits + special_characters = string.punctuation + + # Ensure the generated password meets the required criteria + while True: + password = random.choices(uppercase_letters, k=1) + \ + random.choices(lowercase_letters, k=1) + \ + random.choices(numbers, k=1) + \ + random.choices(special_characters, k=1) + \ + random.choices(uppercase_letters + lowercase_letters + numbers + special_characters, k=length-4) + password = ''.join(password) + if (any(char.isupper() for char in password) and + any(char.islower() for char in password) and + any(char.isdigit() for char in password) and + any(char in special_characters for char in password)): + break + + return password + +print("Welcome to the Linux User Password Generator!") +length = int(input("Please enter the desired password length: ")) + +password = generate_password(length) +print("\nGenerated password:", password)