diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/GUI.iml b/.idea/GUI.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/GUI.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7e83473 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..4c064bc --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/calculator.py b/calculator.py new file mode 100644 index 0000000..4a43019 --- /dev/null +++ b/calculator.py @@ -0,0 +1,35 @@ +from argparse import ArgumentError +import sys + +def add(x, y): + pass + +def sub(x, y): + return x-y + +def mult(x, y): + pass + +def div(x, y): + pass + +if __name__ == '__main__': + if len(sys.argv) != 3: + raise ArgumentError("Incorrect Number of Arguments") + + x = sys.argv[1] + y = sys.argv[2] + + if sys.argv[0].lower() == "add": + print(add(x, y)) + + elif sys.argv[0].lower() == "sub": + print(sub(x, y)) + + elif sys.argv[0].lower() == "mult": + print(mult(x, y)) + + elif sys.argv[0].lower() == "div": + print(div(x, y)) + + else: raise ArgumentError("Invalid Operation") \ No newline at end of file