from decimal import Decimal, getcontext
import math
getcontext().prec = 100
def factorial(n, amount):
final = Decimal(1)
while n > 0:
final *= Decimal(n)
n -= amount
return final
def mathemania(code):
start = Decimal(2)
while len(code) > 0:
current = code[0]
code = code[1:]
if current == "e":
if len(code) > 1:
if code[0] == "(":
start **= Decimal(mathemania(code[1:code.find(")")]))
code = code[code.find(")") + 1:] if code[-1] != ")" else []