INFO
This commit is contained in:
parent
9e928bbec7
commit
5368be695f
34
2.Erste Programme/15. String Vergleich/Quiz.py
Normal file
34
2.Erste Programme/15. String Vergleich/Quiz.py
Normal file
@ -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))
|
14
2.Erste Programme/15. String Vergleich/Quiz_Philipp.py
Normal file
14
2.Erste Programme/15. String Vergleich/Quiz_Philipp.py
Normal file
@ -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
|
BIN
2.Erste Programme/15. String Vergleich/questions.db
Normal file
BIN
2.Erste Programme/15. String Vergleich/questions.db
Normal file
Binary file not shown.
0
2.Erste Programme/16. Funktionen/Funktionen.py
Normal file
0
2.Erste Programme/16. Funktionen/Funktionen.py
Normal file
2
4. Theorie/Datentyp_str.md
Normal file
2
4. Theorie/Datentyp_str.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Neuer Datentyp:
|
||||||
|
str steht für String, also eine Zeichenkette asu einem oder mehreren Buchstaben
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user