Commit 321c98e9 authored by ds201020's avatar ds201020
Browse files

Abgabe1

parent 771354f9
{
"cells": [
{
"cell_type": "markdown",
"id": "2770c9b0-95a9-49b1-aedb-ee82f255d513",
"metadata": {},
"source": [
"# NÖ Card Ausflugsziel - Umsatz - Besucherzahl"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "0c0f9579-a957-4a69-be60-eb725cd914ff",
"metadata": {},
"outputs": [],
"source": [
"class Ausflugsziel(object):\n",
" def __init__(self, name, region, epreis, anz_besucher):\n",
" self.name = name\n",
" self.region = region\n",
" self.epreis = epreis\n",
" self.anz_besucher = anz_besucher\n",
" \n",
" def besucherzahl(self):\n",
" return self.anz_besucher\n",
" def neuer_besucher(self):\n",
" self.anz_besucher += 1\n",
" \n",
" def umsatz(self):\n",
" return self.anz_besucher * self.epreis\n",
" def __str__(self):\n",
" return f\"\"\" \\n Name: {self.name} \\n Region: {self.region} \\n Eintrittspreis: {self.epreis} \\n Besucher Anzahl: {self.anz_besucher} \"\"\""
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "c426448c-bcb2-4fd8-9a4f-c37668f282a6",
"metadata": {},
"outputs": [],
"source": [
"Biergarten = Ausflugsziel(\"Biergarten\", \"Rechts\", 42, 500)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "d8b42e10-1798-46e6-a333-9537043b3a61",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"500\n"
]
}
],
"source": [
"print(Biergarten.besucherzahl())"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "0dcf3df4-4580-42ff-8807-d1367ed8bb1e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" \n",
" Name: Biergarten \n",
" Region: Rechts \n",
" Eintrittspreis: 42 \n",
" Besucher Anzahl: 500 \n"
]
}
],
"source": [
"print(Biergarten)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "92ad7344-a636-41d1-a327-abe70248acb3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"21000\n"
]
}
],
"source": [
"print(Biergarten.umsatz())"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "4facf57b-eef5-4a6b-a4a9-393a7e3f5539",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"502\n"
]
}
],
"source": [
"Biergarten.neuer_besucher()\n",
"print(Biergarten.anz_besucher)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6f070cab-181f-488e-8048-4fe0c50ed903",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment