From 3d921e2fbb8b1107fcabd188483dbe15523042ef Mon Sep 17 00:00:00 2001 From: Rsclub2 2 Date: Thu, 17 Mar 2022 14:46:53 +0100 Subject: [PATCH] UPDATE --- .../13. Zählschleife/13. Zählschleife.py | 2 +- .../version_unterricht.py | 19 +++++++++++++++++++ 4. Theorie/Überischtsblatt.md | 6 +++++- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 2.Erste Programme/4. Fahrkartenautomat Python/version_unterricht.py diff --git a/2.Erste Programme/13. Zählschleife/13. Zählschleife.py b/2.Erste Programme/13. Zählschleife/13. Zählschleife.py index de3aaa5..6a3ec7c 100644 --- a/2.Erste Programme/13. Zählschleife/13. Zählschleife.py +++ b/2.Erste Programme/13. Zählschleife/13. Zählschleife.py @@ -1,4 +1,4 @@ #Zählschleife -for i in range(2,5): +for i in range(5,10,2): print(i) \ No newline at end of file diff --git a/2.Erste Programme/4. Fahrkartenautomat Python/version_unterricht.py b/2.Erste Programme/4. Fahrkartenautomat Python/version_unterricht.py new file mode 100644 index 0000000..129b0e9 --- /dev/null +++ b/2.Erste Programme/4. Fahrkartenautomat Python/version_unterricht.py @@ -0,0 +1,19 @@ +# Fahrkartenautomat +print("Willkommen bei der DB \n Hier können Sie mit Verspätung rechnen. \n Wohin soll es gehen?") +print("1. Erfurt \n 2. Arnstadt \n 3. Suhl") + +erfurt=20 +arnstadt=8 +suhl=15 + +zielort=int(input("Bitte wählen sie ein Zielort aus:")) + +if zielort == 1: + preis=erfurt +elif zielort == 2: + preis=arnstadt +elif zielort == 3: + preis=suhl +else: + print("Bitte geben sie einen gültigen Wert ein.") + exit() diff --git a/4. Theorie/Überischtsblatt.md b/4. Theorie/Überischtsblatt.md index a12ea63..fc98929 100644 --- a/4. Theorie/Überischtsblatt.md +++ b/4. Theorie/Überischtsblatt.md @@ -8,4 +8,8 @@ - for i in range(10): - print(i) (i: Zähler) - for i in range(2,5) (zählt nur von 2 bis 4): - - print(i) \ No newline at end of file + - print(i) + - for i in range(2,10,2) (zählt nur von 2 bis 9 mit 2 Schritten): + - Vorteil: + - Anzahl der Durchläufe ist festgelegt + - Zählschleife wählen, wenn Anzahl der Durchläufe festgelegt ist \ No newline at end of file