Exemple #1
0
def main():
    option = input()
    if option == '1':
        print('Ingresa un valor')
        number = input()
        print(operations.factorial(number))
    elif option == '2':
        print('Ingresa un numero')
        number = input()
        print(operations.fibonacci(number))
    elif option == '3':
        print('The result is: ')
        print(operations.convert_to_uniques())
    else:
        print('The result is: ')
        print(operations.string_apart())
Exemple #2
0
    elif operator == 5:
        result = integer_division(num1, num2)
    elif operator == 6:
        result = power(num1, num2)
    elif operator == 7:
        result = modulo(num1, num2)
    elif operator == 8:
        result = log(num1, num2)
    elif operator == 9:
        result = sigmoid(num1 + num2)
    elif operator == 10:
        result = rand_between(num1, num2)
    elif operator == 11:
        result = hcf(num1, num2)
    elif operator == 12:
        result = factorial(num1)
    elif operator == 13:
        result = exponential(num1)
    elif operator == 14:
        result = Sine()
    elif operator == 15:
        result = Cosine()
    elif operator == 16:
        result = Tangent()
    elif operator == 17:
        break
    else:
        result = "Enter a valid input. Try again!"

    print(f"\nThe output of the selected operation is {result}")
Exemple #3
0
 def test_factorial(self):
     self.assertEqual(operations.factorial(-5), -1)
     self.assertEqual(operations.factorial(3.4), -1)
     self.assertEqual(operations.factorial(0), 1)
     self.assertEqual(operations.factorial(0), 1)
     self.assertEqual(operations.factorial(5), 120)