This commit is contained in:
ltcptgeneral 2020-04-30 15:22:37 -05:00
parent 5ea3f730e5
commit 551e27a4b4

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 164, "execution_count": 2,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -13,7 +13,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 165, "execution_count": 3,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -25,7 +25,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 166, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -45,7 +45,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 167, "execution_count": 5,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -57,7 +57,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 168, "execution_count": 6,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -69,7 +69,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 169, "execution_count": 7,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -81,7 +81,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 170, "execution_count": 12,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -90,22 +90,46 @@
" string = div(string)\n", " string = div(string)\n",
" string = mul(string)\n", " string = mul(string)\n",
" string = sub(string)\n", " string = sub(string)\n",
" print(string)\n",
" string = add(string)\n", " string = add(string)\n",
" return string" " return string"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 171, "execution_count": 13,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{
"output_type": "error",
"ename": "SyntaxError",
"evalue": "unexpected EOF while parsing (<ipython-input-13-f9fb4aededd9>, line 1)",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-13-f9fb4aededd9>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m def parentheses(string):\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unexpected EOF while parsing\n"
]
}
],
"source": [
"def parentheses(string):"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "-158456325028528675187087900672.000000+0.8\n"
},
{ {
"output_type": "execute_result", "output_type": "execute_result",
"data": { "data": {
"text/plain": "'-158456325028528675187087900672.000000'" "text/plain": "'-158456325028528675187087900672.000000'"
}, },
"metadata": {}, "metadata": {},
"execution_count": 171 "execution_count": 22
} }
], ],
"source": [ "source": [
@ -113,6 +137,94 @@
"evaluate(string)" "evaluate(string)"
] ]
}, },
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"from sympy import symbols, solve"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": "[6]"
},
"metadata": {},
"execution_count": 26
}
],
"source": [
"x = symbols(\"x\")\n",
"expr = x-4-2\n",
"sol = solve(expr)\n",
"sol"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "x - 6\n"
}
],
"source": [
"print(expr)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"expr = \"x-4-2\""
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": "[6]"
},
"metadata": {},
"execution_count": 29
}
],
"source": [
"sol = solve(expr)\n",
"sol"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "x-4-2\n"
}
],
"source": [
"print(expr)"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,