Generation

generate functionTue, 29 Nov 2022

generate a formula which has a string parameter, the formula should check that the string is convertable to int

def generate_formula(param_string): return lambda x: int(x) + int(param_string) formula = generate_formula('10') formula(2)

Questions about programming?Chat with your personal AI assistant