Last active
November 13, 2017 10:16
-
-
Save joergre/c79a70421a5493d22656330cf4fd85c7 to your computer and use it in GitHub Desktop.
zahlenraten
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.py: | |
unittest | |
import zahlenraten | |
class TestStringMethods(unittest.TestCase): | |
pass | |
zahlenraten.py: | |
def eingabe(eingabewert): | |
try: | |
eingabewert = int(eingabewert) | |
if 0<= eingabewert <=100: | |
return(1) | |
else: | |
return(0) | |
except ValueError: | |
return(0) | |
def ueberpruefung(eingabe, testwert): | |
pass | |
def zufallszahl(): | |
pass | |
zahl = zufallszahl() | |
while True: | |
eingabewert = input("Bitte eine Zahl eingeben: ") | |
if eingabe(eingabewert) == 1: | |
break | |
ueberpruefung(eingabewert, zahl) | |
def ueberpruefung(eingabe): | |
try: | |
eingabe = int(eingabe) | |
if 0<= eingabe <=100: | |
return(1) | |
else: | |
return(0) | |
except ValueError: | |
return(0) | |
def zufallszahl(): | |
pass | |
eingabewert = input("Bitte eine Zahl eingeben: ") | |
print(ueberpruefung(eingabewert)) | |
print("Das Spiel ist zu Ende") | |
print("Das Spiel ist zu Ende") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ueberpruefung(eingabe): | |
try: | |
eingabe = int(eingabe) | |
if 0<= eingabe <=100: | |
return(1) | |
else: | |
return(0) | |
except ValueError: | |
return(0) | |
def zufallszahl(): | |
pass | |
eingabewert = input("Bitte eine Zahl eingeben: ") | |
print(ueberpruefung(eingabewert)) | |
print("Das Spiel ist zu Ende") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment