If the mention of algebra conjures bad memories of math classes, a Python library called SymPy could change your mind about the subject. With SymPy, algebraic operations become easier than tedious ...
def generate_primary_problem(): """生成小学四则运算题目""" operators = ['+', '-', '*', '/'] a = random.randint(1, 20) b = random.randint(1, 20) operator ...