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

@ -27,10 +27,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Térfogat: 120\n",
"Felszín: 148\n"
]
}
],
"source": [
"a = 4\n",
"b = 5\n",
"c = 6\n",
"\n",
"print(f\"Térfogat: {a*b*c}\" )\n",
"print(f\"Felszín: {2*(a*b + a*c + b*c)}\" )"
]
},
{
"cell_type": "markdown",
@ -43,10 +59,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'b' nagyobb\n"
]
}
],
"source": [
"a = int(input(\"Első szám: \"))\n",
"b = int(input(\"Második szám: \"))\n",
"\n",
"print(\"'a' nagyobb\") if a > b else print(\"'b' nagyobb\")"
]
},
{
"cell_type": "markdown",
@ -65,10 +94,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"6 12 \n",
" **\n",
" ****\n",
" ******\n",
" ********\n"
]
}
],
"source": [
"for i in range(a, b, 1):\n",
" if i % c == 0:\n",
" print(i, end=' ') \n",
"\n",
"for i in range(5):\n",
" print((5-i)* ' ' + '*'*i*2)"
]
},
{
"cell_type": "markdown",
@ -87,7 +135,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
@ -101,7 +149,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.13.0"
}
},
"nbformat": 4,