Python Interpret String As Variable Cost