online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
a = input() if a == "sinx": k = "cosx" elif a == "cosx": k = "-sinx" elif a == "cscx": k = "-cscx cotx" elif a == "tanx": k = "sec^2 (x)" else: if "+" in a: m = a.split("+") elif "-" in a: m = a.split("-") elif "+" not in a and "-" not in a: a = a + "+ 0" m = a.split("+") i = 0 ma = [] while i < len(m): if "^" in m[i] and "ln" not in m[i]: c = m[i].index("^") b = m[i] ma.append(str(int(b[0:c-1]) * int(b[c+1:])) + "x" + "^" + str(int(b[c+1:])-1)) s = ma[i] if s[(c)] == "0": ma[i] = str(ma[i])[0:c-2] elif "x" not in m[i]: m[i] = None elif "ln" in m[i]: s = m[i] o = s.index("l") pa = s.index("x") ya = s.index("n") ma.append(str(int(s[:o]) * int(s[(ya + 1):int(pa)])) + "/(" + str(s[int(o+2):] + ")")) if m[i] == "sinx": ma.append("cosx") elif m[i] == "cosx": ma.append("-sinx") elif m[i] == "cscx": ma.append("-cscx cotx") elif m[i] == "tanx": ma[i].append("sec^2 (x)") i = i + 1 if i == len(m): break p = 0 ma.reverse() k = None while p < len(ma): if "+" in a: k = ma[p] + " + " + str(k) elif "-" in a: k = ma[p] + "-" + str(k) p = p + 1 if p == len(ma): break if "-" in a: k = k[0:len(k)-5] elif "+" in a: k = k[0:len(k)-6] k = "f'(x) = " + k print(k)

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