Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raganmd/7fb2bcbddbae63efbe56484f51c10298 to your computer and use it in GitHub Desktop.
Save raganmd/7fb2bcbddbae63efbe56484f51c10298 to your computer and use it in GitHub Desktop.
def switcher(func_name, val1, val2):
if func_name == "Add":
result = val1 + val2
elif func_name == "Subtract":
result = val1 - val2
elif func_name == "Multiply":
result = val1 * val2
elif func_name == "Divide":
result = val1 / val2
return result
print( switcher("Subtract", 1, 2) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment