differentiation by whatisgolf

import re;S=re.sub
while 1:print S('\^1|[x+-]+\d*$','',S('(\d+)x\^((.))',lambda m:eval("`%s*%s`+'x^'+`%s-1`"%m.groups()),raw_input()))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page