online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import os, re def clearConsole(): os.system('cls' if os.name in ('nt', 'dos') else 'clear') def comma2Dot(value): return value.replace(",", ".") def removeSpaces(value): return re.sub(r"\s", "", value) def insertValueFor(expression, variable, value): return expression.replace(variable, value) allowedCharacters = [ ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '*', '/', '(', ')', '.', 'p', 'i', 'x', 'r' ] while True: expression = input("Wprowadź wyrażenie: ") expression = removeSpaces(expression.lower()) if expression == "": continue expression = comma2Dot(expression) if all(character in allowedCharacters for character in expression): if "x" in expression: x = float(comma2Dot(input("Podaj wartość dla x: "))) expression = insertValueFor(expression, "x", str(x)) if "r" in expression: r = float(comma2Dot(input("Podaj wartość dla r: "))) expression = insertValueFor(expression, "r", str(r)) if "pi" in expression: expression = insertValueFor(expression, "pi", "3.14") try: print("\n" + expression) print(round(eval(expression), 2)) except ZeroDivisionError: print("Bład dzielenia przez zero") except: print("Nieprawidłowe wyrażenie") else: if expression in ["s", "stop"]: exit() elif expression in ["c", "cls"]: clearConsole() continue else: print("Wprowadzone wyrażenie zawiera niedozwolone znaki") print()

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue