Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions 1.-Python/1.-Snail-and-Well/snail-and-well.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"well_height = 125\n",
"daily_distance = 30\n",
"nightly_distance = -20\n",
"snail_position = 0"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -161,9 +166,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.8.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
32 changes: 25 additions & 7 deletions 1.-Python/2.-Duel-of-Sorcerers/duel-of-sorcerers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": []
"source": [
"gandalf = [10, 11, 13, 30, 22, 11, 10, 33, 22, 22]\n",
"saruman = [23, 66, 12, 43, 12, 10, 44, 23, 12, 17]\n",
"spells = 10"
]
},
{
"cell_type": "markdown",
Expand All @@ -64,10 +68,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": []
"source": [
"gandalf_wins = 0\n",
"saruman_wins = 0"
]
},
{
"cell_type": "markdown",
Expand All @@ -81,7 +88,18 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"for spells in zip(gandalf, saruman):\n",
" gandalf_spell = [0]\n",
" saruman_spell = [1]\n",
" if gandalf_spell>saruman_spell:\n",
" gandalf_wins += 1\n",
" elif saruman_spell>gandalf_spell:\n",
" saruman_wins += 1\n",
"\n",
"print(\"Total Gandalf wins:\", gandalf_wins)\n",
"print(\"Total Saruman wins:\", saruman_wins)"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -221,9 +239,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.8.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Empty file added robot.md
Empty file.