Skip to content

Instantly share code, notes, and snippets.

@kokuyokugetter
Created August 15, 2020 07:22
Show Gist options
  • Save kokuyokugetter/0b3718a7b0bd0adf8f3c0f6f6e483b9e to your computer and use it in GitHub Desktop.
Save kokuyokugetter/0b3718a7b0bd0adf8f3c0f6f6e483b9e to your computer and use it in GitHub Desktop.
test
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"A = [10000,20000,30000,40000,50000,60000,70000,80000,90000]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"362880000000000000000000000000000000000000\n"
]
}
],
"source": [
"b = 1\n",
"for i in A:\n",
" b *= i\n",
"print(b)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"4125042171973730304"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import numpy as np\n",
"np.prod(A)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"15 : 1307674368000\n",
"16 : 20922789888000\n",
"17 : 355687428096000\n",
"18 : 6402373705728000\n",
"19 : 121645100408832000\n",
"20 : 2432902008176640000\n",
"21 : 51090942171709440000\n",
"22 : 1124000727777607680000\n",
"23 : 25852016738884976640000\n",
"24 : 620448401733239439360000\n"
]
}
],
"source": [
"c = 1\n",
"for i in range(1,25):\n",
" c *= i\n",
" if i >= 15:\n",
" print(i, \":\" ,c)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"15 : 1307674368000\n",
"16 : 20922789888000\n",
"17 : 355687428096000\n",
"18 : 6402373705728000\n",
"19 : 121645100408832000\n",
"20 : 2432902008176640000\n",
"21 : -4249290049419214848\n",
"22 : -1250660718674968576\n",
"23 : 8128291617894825984\n",
"24 : -7835185981329244160\n"
]
}
],
"source": [
"for i in range(15, 25):\n",
" d = np.prod(range(1,i+1))\n",
" print(i, \":\", d)"
]
}
],
"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.6.6+"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment