From 5368be695f90ca68a41781b7dd924205b02d4735 Mon Sep 17 00:00:00 2001 From: Rsclub2 2 Date: Thu, 23 Jun 2022 14:34:56 +0200 Subject: [PATCH] INFO --- .../15. String Vergleich/Quiz.py | 34 ++++++++++++++++++ .../15. String Vergleich/Quiz_Philipp.py | 14 ++++++++ .../15. String Vergleich/questions.db | Bin 0 -> 8192 bytes .../16. Funktionen/Funktionen.py | 0 4. Theorie/Datentyp_str.md | 2 ++ 4. Theorie/Thumbs.db | Bin 41472 -> 41472 bytes 6 files changed, 50 insertions(+) create mode 100644 2.Erste Programme/15. String Vergleich/Quiz.py create mode 100644 2.Erste Programme/15. String Vergleich/Quiz_Philipp.py create mode 100644 2.Erste Programme/15. String Vergleich/questions.db create mode 100644 2.Erste Programme/16. Funktionen/Funktionen.py create mode 100644 4. Theorie/Datentyp_str.md diff --git a/2.Erste Programme/15. String Vergleich/Quiz.py b/2.Erste Programme/15. String Vergleich/Quiz.py new file mode 100644 index 0000000..29904d1 --- /dev/null +++ b/2.Erste Programme/15. String Vergleich/Quiz.py @@ -0,0 +1,34 @@ +punkte=0 + +#Frage 1 +korrekt="c" +print("Welchees ist die größte Wüste") +print("a-Gobi\nb-Sahra\nc-Antarktis\nd-Arktis") + +antwort = str(input("Ihre Antwort:")) +#str sthet für String, also eine Zeichenkette aus einem oder mehreren Buchstaben + +if antwort==korrekt: + print ('Die Antowrt: "%s" ist richtig.'%(antwort)) + punkte=punkte+1 + print("Sie haben jetzt %sPunkte."%(punkte)) +else: + print ('Die Antwort: "%s" ist falsch.'%(antwort)) + print("Sie haben jetzt %sPunkte."%(punkte)) + + +#Frage 2 +korrekt="c" +print("") +print("a-\nb-\nc-\nd-") + +antwort = str(input("Ihre Antwort:")) +#str sthet für String, also eine Zeichenkette aus einem oder mehreren Buchstaben + +if antwort==korrekt: + print ('Die Antowrt: "%s" ist richtig.'%(antwort)) + punkte=punkte+1 + print("Sie haben jetzt %sPunkte."%(punkte)) +else: + print ('Die Antwort: "%s" ist falsch.'%(antwort)) + print("Sie haben jetzt %sPunkte."%(punkte)) \ No newline at end of file diff --git a/2.Erste Programme/15. String Vergleich/Quiz_Philipp.py b/2.Erste Programme/15. String Vergleich/Quiz_Philipp.py new file mode 100644 index 0000000..655dc58 --- /dev/null +++ b/2.Erste Programme/15. String Vergleich/Quiz_Philipp.py @@ -0,0 +1,14 @@ +# Make a programm which asks Quiz Questions, which are stored in a database +import sqlite3 + +punkte=0 +i=0 +con = sqlite3.connect('questions.db') +cur = con.cursor() +# Fetch Questions +while(True): + i+1 + question=cur.execute("SELECT QUESTION FROM QUESTIONS WHERE NUMBER is %s"%(i)) + print(question) + break +# @Philipp: fortsetzen \ No newline at end of file diff --git a/2.Erste Programme/15. String Vergleich/questions.db b/2.Erste Programme/15. String Vergleich/questions.db new file mode 100644 index 0000000000000000000000000000000000000000..4ba49a77988ce22da03c2380b6513d84b73acea8 GIT binary patch literal 8192 zcmeI$y9&ZE6b9fE5u^pFn`2`pMGF*-kX|SV zKmY;|fB*y_009U<00Izz00gwagSEQ0&ECT-J>AaHUM9-lg-LyBtYhgY$(7>B)GcTh)Xxlsu@S6Z_sqmC+oOZ}Xh29Q+V~00bZa0SG_<0uX=z a1Rwwb2>gkF#hOOXQu@T literal 0 HcmV?d00001 diff --git a/2.Erste Programme/16. Funktionen/Funktionen.py b/2.Erste Programme/16. Funktionen/Funktionen.py new file mode 100644 index 0000000..e69de29 diff --git a/4. Theorie/Datentyp_str.md b/4. Theorie/Datentyp_str.md new file mode 100644 index 0000000..a3be344 --- /dev/null +++ b/4. Theorie/Datentyp_str.md @@ -0,0 +1,2 @@ +# Neuer Datentyp: +str steht für String, also eine Zeichenkette asu einem oder mehreren Buchstaben \ No newline at end of file diff --git a/4. Theorie/Thumbs.db b/4. Theorie/Thumbs.db index 8504b2a09aef2eb000427adb3cd0a31fca5af430..f9f70b22871d9b295ed01dfeda1c40859f8463d9 100644 GIT binary patch delta 77 zcmZoT!qjktX+tgx>-pc0c-uA?u}otYh__(?0~_@m>vt17XKhyGxX(D*fQ54smjH*} Y_VubPkM&qLOK|-#