Created
June 4, 2018 06:15
-
-
Save raganmd/7fb2bcbddbae63efbe56484f51c10298 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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