From 354c195e826222a371c2d8d5f238d279dff93179 Mon Sep 17 00:00:00 2001 From: ltcptgeneral <35508619+ltcptgeneral@users.noreply.github.com> Date: Wed, 29 Apr 2020 00:34:16 -0500 Subject: [PATCH] 1 --- .devcontainer/devcontainer.json | 1 + .../equation-checkpoint.ipynb | 35 ++++++++ .../analysis-amd64/analysis/equation.ipynb | 80 +++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 analysis-master/analysis-amd64/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb create mode 100644 analysis-master/analysis-amd64/analysis/equation.ipynb diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9b5120ed..6f6cd0c9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,6 +21,7 @@ }, "extensions": [ "mhutchie.git-graph", + "donjayamanne.jupyter", ], "postCreateCommand": "pip install -r analysis-master/analysis-amd64/requirements.txt" } \ No newline at end of file diff --git a/analysis-master/analysis-amd64/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb b/analysis-master/analysis-amd64/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb new file mode 100644 index 00000000..9245ab26 --- /dev/null +++ b/analysis-master/analysis-amd64/analysis/.ipynb_checkpoints/equation-checkpoint.ipynb @@ -0,0 +1,35 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "string = \"3+4+5\"\n", + "re.sub(\"\\d+[+]{1}\\d+\", string, sum([int(i) for i in re.split(\"[+]{1}\", re.search(\"\\d+[+]{1}\\d+\", string).group())]))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/analysis-master/analysis-amd64/analysis/equation.ipynb b/analysis-master/analysis-amd64/analysis/equation.ipynb new file mode 100644 index 00000000..ce9c6f2d --- /dev/null +++ b/analysis-master/analysis-amd64/analysis/equation.ipynb @@ -0,0 +1,80 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 148, + "metadata": {}, + "outputs": [], + "source": [ + "import re" + ] + }, + { + "cell_type": "code", + "execution_count": 152, + "metadata": {}, + "outputs": [], + "source": [ + "string = \"3+45+-5\"" + ] + }, + { + "cell_type": "code", + "execution_count": 153, + "metadata": {}, + "outputs": [], + "source": [ + "def add(string):\n", + " while(len(re.findall(\"[+]{1}[-]?\", string)) != 0):\n", + " string = re.sub(\"\\d+[+]{1}[-]?\\d+\", str(sum([int(i) for i in re.split(\"[+]{1}\", re.search(\"\\d+[+]{1}[-]?\\d+\", string).group())])), string, 1)\n", + " return string" + ] + }, + { + "cell_type": "code", + "execution_count": 154, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": "'7*0'" + }, + "metadata": {}, + "execution_count": 154 + } + ], + "source": [ + "add(string)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.6-final" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file