Automatic push from FunctionsAPI

This commit is contained in:
FunctionsAPI 2025-01-23 02:40:18 +00:00
parent 94ea26bf2b
commit 707cd4e5ea
3 changed files with 41 additions and 2 deletions

View File

@ -1,2 +1 @@
# e01214314b5a47b19b544aec8dee01a8
# python hello-world

38
main.py Normal file
View File

@ -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()

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
functions-framework==1.4.3
markupsafe==2.0.1