You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
219 lines
5.5 KiB
Plaintext
219 lines
5.5 KiB
Plaintext
4 years ago
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 117,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"A house of tin \n",
|
||
|
" at leslie-s \n",
|
||
|
" Using a fire torch\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of paperbox \n",
|
||
|
" in pzi \n",
|
||
|
" Using a led torch\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of paperbox \n",
|
||
|
" in a forest \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of paperbox \n",
|
||
|
" in pzi \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of stone \n",
|
||
|
" in liverpool \n",
|
||
|
" Using a fire torch\n",
|
||
|
" Inhabited by donald.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"import random\n",
|
||
|
"\n",
|
||
|
"a = ('chips','foil','tin','stone','paperbox')\n",
|
||
|
"b = ('in a forest','in pzi','at leslie-s','in liverpool')\n",
|
||
|
"c = ('a yellow submarine','a led torch','a fire torch')\n",
|
||
|
"d = ('tintin','dustman','david bowie','donald')\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"for x in range(5):\n",
|
||
|
" \n",
|
||
|
" ma = random.randint(0,len(a)-1)\n",
|
||
|
" mb = random.randint(0,len(b)-1)\n",
|
||
|
" mc = random.randint(0,len(c)-1)\n",
|
||
|
" md = random.randint(0,len(d)-1)\n",
|
||
|
" \n",
|
||
|
" print(f\"\"\"A house of {a[ma]} \n",
|
||
|
" {b[mb]} \n",
|
||
|
" Using {c[mc]}\n",
|
||
|
" Inhabited by {d[md]}.\"\"\")\n",
|
||
|
"\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 120,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"a = ('chips','foil','tin','stone','paperbox')\n",
|
||
|
"b = ('in a forest','in pzi','at leslie-s','in liverpool')\n",
|
||
|
"c = ('a yellow submarine','a led torch','a fire torch')\n",
|
||
|
"d = ('tintin','dustman','david bowie','donald')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 120,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"for x in range(5):\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" ma = random.choice(a)\n",
|
||
|
" mb = random.choice(b)\n",
|
||
|
" mc = random.choice(c)\n",
|
||
|
" md = random.choice(d)\n",
|
||
|
" \n",
|
||
|
" print(f\"\"\"A house of {ma} \n",
|
||
|
" {mb} \n",
|
||
|
" Using {mc}\n",
|
||
|
" Inhabited by {md}.\"\"\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 120,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"A house of chips \n",
|
||
|
" at leslie-s \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of tin \n",
|
||
|
" in a forest \n",
|
||
|
" Using a fire torch\n",
|
||
|
" Inhabited by tintin.\n",
|
||
|
"A house of tin \n",
|
||
|
" in a forest \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by david bowie.\n",
|
||
|
"A house of tin \n",
|
||
|
" in a forest \n",
|
||
|
" Using a led torch\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of chips \n",
|
||
|
" in pzi \n",
|
||
|
" Using a led torch\n",
|
||
|
" Inhabited by tintin.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 123,
|
||
|
"metadata": {
|
||
|
"collapsed": true,
|
||
|
"jupyter": {
|
||
|
"outputs_hidden": true
|
||
|
}
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"A house of stone \n",
|
||
|
" at leslie-s \n",
|
||
|
" Using a fire torch\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of foil \n",
|
||
|
" in liverpool \n",
|
||
|
" Using a fire torch\n",
|
||
|
" Inhabited by donald.\n",
|
||
|
"A house of chips \n",
|
||
|
" in pzi \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by david bowie.\n",
|
||
|
"A house of stone \n",
|
||
|
" at leslie-s \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by david bowie.\n",
|
||
|
"A house of chips \n",
|
||
|
" in liverpool \n",
|
||
|
" Using a yellow submarine\n",
|
||
|
" Inhabited by dustman.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 144,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"ah ok\n",
|
||
|
"\n",
|
||
|
"vediamo\n",
|
||
|
"\n",
|
||
|
"ciccio\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"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.8.6"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 4
|
||
|
}
|