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") 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) 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