def parse_n(str):
    "Parse the number part of a polynomial string term"
    if not str: return 1
    elif str == '-': return -1
    elif str == '+': return 1
    return eval(str)
Parse the number part of a polynomial string term
recipes/Python/362193_Manipulate_simple_polynomials/recipe-362193.py