Created
February 13, 2017 14:38
-
-
Save MagicHen25/474ed78cc598d9b15cb470735333e156 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
import re | |
def multiplyDivideFunc(inStr): | |
outList = list() | |
if "*" in inStr: | |
# print("Multiply in inStr") | |
outList = inStr.split("*") | |
# print(float(outList[0])*float(outList[1])) | |
return float(outList[0])*float(outList[1]) | |
elif "/" in inStr: | |
# print("Divide in inStr") | |
outList = inStr.split("/") | |
# print(float(outList[0]) / float(outList[1])) | |
return float(outList[0]) / float(outList[1]) | |
else: | |
# print("Only a digit:", float(inStr)) | |
return float(inStr) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment