Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniruddh-0701 committed Oct 30, 2020
1 parent 1fb448a commit b6c0972
Show file tree
Hide file tree
Showing 2 changed files with 513 additions and 8 deletions.
84 changes: 80 additions & 4 deletions .ipynb_checkpoints/Modules_and_Packages-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,21 @@
"print(__primeval__)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## globals(), locals() and reload()\n",
"\n",
"globals - returns the list of objects that can be accessed globally from that point.\n",
"\n",
"locals - returns the list of objects that can be accessed locally from that point.\n",
"\n",
"reload - reloads the given module. (imported from impotlib module)\n",
"\n",
"Syntax: `reload(module_name)`"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -798,15 +813,15 @@
}
],
"source": [
"math.pow(2, 3)"
"math.pow(2, 3) # 2 ** 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$^5P_2$ \n",
"$^5C_2$"
"$\\mathit{^5P_2}$ \n",
"$\\mathit{^5C_2}$"
]
},
{
Expand Down Expand Up @@ -846,7 +861,68 @@
}
],
"source": [
"math.comb(5, 2)"
"math.comb(5, 2) # 5C2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## cmath:\n",
"Like math, used to work with complex numbers."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"__doc__\n",
"__loader__\n",
"__name__\n",
"__package__\n",
"__spec__\n",
"acos\n",
"acosh\n",
"asin\n",
"asinh\n",
"atan\n",
"atanh\n",
"cos\n",
"cosh\n",
"e\n",
"exp\n",
"inf\n",
"infj\n",
"isclose\n",
"isfinite\n",
"isinf\n",
"isnan\n",
"log\n",
"log10\n",
"nan\n",
"nanj\n",
"phase\n",
"pi\n",
"polar\n",
"rect\n",
"sin\n",
"sinh\n",
"sqrt\n",
"tan\n",
"tanh\n",
"tau\n"
]
}
],
"source": [
"import cmath\n",
"\n",
"print(*dir(cmath), sep='\\n')"
]
},
{
Expand Down
Loading

0 comments on commit b6c0972

Please sign in to comment.