diff --git a/README.md b/README.md index f2711cc..ca9945f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# e01214314b5a47b19b544aec8dee01a8 - +# python hello-world diff --git a/main.py b/main.py new file mode 100644 index 0000000..c8fe6b9 --- /dev/null +++ b/main.py @@ -0,0 +1,38 @@ +def main(): + print("Welcome to the Simple Math Calculator!") + print("Please choose an operation: +, -, *, /") + + # Get operation from the user + operation = input("Enter operation: ") + + # Get two numbers from the user + try: + num1 = float(input("Enter the first number: ")) + num2 = float(input("Enter the second number: ")) + except ValueError: + print("Invalid input! Please enter numeric values.") + return + + # Perform the selected operation + if operation == '+': + result = num1 + num2 + elif operation == '-': + result = num1 - num2 + elif operation == '*': + result = num1 * num2 + elif operation == '/': + if num2 == 0: + print("Error: Division by zero is not allowed!") + return + result = num1 / num2 + else: + print("Invalid operation! Please choose +, -, *, or /.") + return + + # Display the result + print(f"The result of {num1} {operation} {num2} is: {result}") + +# Call the main function +if __name__ == "__main__": + main() + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..55e8614 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +functions-framework==1.4.3 +markupsafe==2.0.1