Technologische_Grundlagen/course/python/.ipynb_checkpoints/03-loops-checkpoint.ipynb

98 lines
1.8 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "3eea86ad-74b7-4d9c-8cac-814d6e9858e9",
"metadata": {},
"source": [
"### Loops"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "8ba4b151-0dcc-4f65-9b0c-1d242fe63d9a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Axel\n",
"Elke\n",
"Martin\n",
"nach der for-Schleife\n"
]
}
],
"source": [
"vornamen = ['Axel', 'Elke', 'Martin']\n",
"for einzelwert in vornamen:\n",
" print(einzelwert)\n",
"print(\"nach der for-Schleife\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "d5d85399-b41a-433f-b6c2-279197a40157",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"2\n",
"3\n",
"4\n",
"5\n",
"6\n",
"7\n",
"8\n",
"9\n",
"10\n",
"nach der Schleife\n"
]
}
],
"source": [
"durchgang = 1\n",
"while durchgang < 11:\n",
" print(durchgang)\n",
" durchgang = durchgang + 1\n",
"print(\"nach der Schleife\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "32f0f630-7392-449b-a33b-ee5250752bb6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}