Created
February 13, 2017 14:38
-
-
Save MagicHen25/15984582fca45112102f4d74a0def7d9 to your computer and use it in GitHub Desktop.
Revisions
-
MagicHen25 created this gist
Feb 13, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ 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)