Generation

generate functionSun, 13 Nov 2022

Generate Function

def add(a, b): return a + b def sub(a, b): return a - b def genFunction(name): if name == 'add': return add elif name == 'sub': return sub else: return None add1 = genFunction('add') add1(1, 2)

Questions about programming?Chat with your personal AI assistant