working socket integration

This commit is contained in:
2025-04-21 21:03:59 +05:30
parent c143efa70e
commit 4453e69e68
22 changed files with 2070 additions and 60 deletions

View File

@@ -0,0 +1,24 @@
# Interactive Calculator Example
# This demonstrates how the interactive input/output works
def calculator():
print("Welcome to the Interactive Calculator!")
print("Enter 'q' to quit at any time.")
while True:
expression = input("Enter an expression (e.g., 2 + 3): ")
if expression.lower() == 'q':
print("Thank you for using the Interactive Calculator!")
break
try:
# Safely evaluate the expression
result = eval(expression)
print(f"Result: {result}")
except Exception as e:
print(f"Error: {str(e)}")
print("Please try again with a valid expression.")
# Run the calculator
calculator()