Add solution #14

Open
malgorzatawi wants to merge 1 commit from malgorzatawi/2025-plovdiv-data:ex into main
Showing only changes of commit 68a4f94dbd - Show all commits

View file

@ -36,9 +36,9 @@
"output_type": "stream",
"text": [
"-- Deck 1: --\n",
" ['The Lovers', 'Temperance', 'The Emperor', 'The Sun', 'The Fool', 'The Chariot', 'Death', 'Strength', 'Justice', 'The Star', 'Judgement', 'The World', 'The Tower', 'The Hanged Man', 'The Empress', 'The Hermit', 'The Devil', 'The High Priestess', 'The Moon', 'The Hierophant', 'Wheel of Fortune', 'The Magician']\n",
" ['The Empress', 'The Hermit', 'Death', 'Justice', 'The Magician', 'The Lovers', 'Wheel of Fortune', 'The Fool', 'The Tower', 'The Hierophant', 'The World', 'The Moon', 'Judgement', 'The Chariot', 'The Sun', 'The High Priestess', 'Strength', 'The Hanged Man', 'The Emperor', 'The Devil', 'Temperance', 'The Star']\n",
"-- Deck 2: --\n",
" ['The Fool', 'Death', 'The Hermit', 'Strength', 'The Moon', 'Wheel of Fortune', 'Judgement', 'The Lovers', 'The Star', 'The Hanged Man', 'The Empress', 'The Emperor', 'The Magician', 'The Tower', 'The Hierophant', 'The Chariot', 'The High Priestess', 'Temperance', 'The World', 'The Devil', 'The Sun', 'Justice']\n"
" ['Justice', 'Temperance', 'The Hanged Man', 'Strength', 'The Magician', 'The Tower', 'Wheel of Fortune', 'The Moon', 'The Lovers', 'The Fool', 'Judgement', 'The Star', 'Death', 'The Hierophant', 'The Empress', 'The High Priestess', 'The Hermit', 'The Sun', 'The Chariot', 'The Devil', 'The Emperor', 'The World']\n"
]
}
],
@ -69,16 +69,66 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"id": "48eb31e2",
"metadata": {},
"outputs": [],
"source": []
"source": [
"set1 = set(deck1)\n",
"\n",
"matching = []\n",
"\n",
"for indx, card in enumerate(deck2):\n",
" if card in set1:\n",
" matching.append((deck2.index(card), deck1.index(card)))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "509dda71",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[(0, 3),\n",
" (1, 20),\n",
" (2, 17),\n",
" (3, 16),\n",
" (4, 4),\n",
" (5, 8),\n",
" (6, 6),\n",
" (7, 11),\n",
" (8, 5),\n",
" (9, 7),\n",
" (10, 12),\n",
" (11, 21),\n",
" (12, 2),\n",
" (13, 9),\n",
" (14, 0),\n",
" (15, 15),\n",
" (16, 1),\n",
" (17, 14),\n",
" (18, 13),\n",
" (19, 19),\n",
" (20, 18),\n",
" (21, 10)]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"matching"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "509dda71",
"id": "50d68467",
"metadata": {},
"outputs": [],
"source": []
@ -86,7 +136,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
@ -100,7 +150,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.13.6"
}
},
"nbformat": 4,