DoneSomeWork

This commit is contained in:
2024-12-05 20:20:03 +01:00
parent 5f0f81a790
commit bcff76d934
3 changed files with 277 additions and 61 deletions

View File

@ -34,10 +34,37 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{500: 1, 200: 2, 5: 1}\n",
"cba\n"
]
}
],
"source": [
"euro = (500, 200, 100, 50, 20, 10, 5, 2, 1)\n",
"\n",
"num = int(input(\"Adjon meg egy számot! \"))\n",
"ret = {}\n",
"for i in euro:\n",
" while num // i > 0:\n",
" if i not in ret.keys():\n",
" ret.update({i : 1})\n",
" else:\n",
" ret[i] += 1\n",
" num = num - i\n",
" #ret.append(i)\n",
"\n",
"print(ret)\n",
"\n",
"\n",
"print(\"abc\"[::-1])"
]
},
{
"cell_type": "markdown",
@ -51,7 +78,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
@ -65,7 +92,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.13.0"
}
},
"nbformat": 4,