Calculator B

Run Settings
LanguagePython
Language Version
Run Command
x = '1 + 2' y = x.split() print(y) a = float(y[0]) b = y[1] c = float(y[2]) if (type(a) == int or type(a) == float) and (b in ['+','-','x','/']): if (type(c) == int or type(c) == float): if b=='+': result = a + c if b == '-': result = a - c if b == 'x': result = a * c if b == '/': result = a/c print(result) else: print("input error")
Editor Settings
Theme
Key bindings
Full width
Lines