diff --git a/Aufgabe1.py b/aufgabe1/Aufgabe1.py similarity index 100% rename from Aufgabe1.py rename to aufgabe1/Aufgabe1.py diff --git a/Aufgabe2.py b/aufgabe1/Aufgabe2.py similarity index 100% rename from Aufgabe2.py rename to aufgabe1/Aufgabe2.py diff --git a/Aufgabe3.py b/aufgabe1/Aufgabe3.py similarity index 100% rename from Aufgabe3.py rename to aufgabe1/Aufgabe3.py diff --git a/Tutorium1.md b/aufgabe1/Tutorium1.md similarity index 100% rename from Tutorium1.md rename to aufgabe1/Tutorium1.md diff --git a/aufgabe2/Tutorium2.md b/aufgabe2/Tutorium2.md new file mode 100644 index 0000000000000000000000000000000000000000..e1b39286271b14b242dafa635ea31d3d4eaceaae --- /dev/null +++ b/aufgabe2/Tutorium2.md @@ -0,0 +1,26 @@ +# Aufgabe 2.1 + +Schreiben Sie ein Programm, dass eine Benutzereingabe auf ein vorher definiertes Wort prüft. Dabei soll der Benutzer eine begrenzte Anzahl an Versuchen haben. + + - Die Anzahl der Versuche soll der Funktion übergeben werden + - Nutzen für das Wort die gegebene Funktion get_random_word() + +Boilerplate: guessme.py + +# Aufgabe 2.2 + +Schreiben Sie ein Programm, dass eine Pyramide mit Höhe n auf die Kommandozeile druckt. + +Beispiel: n = 5 + += +== +=== +==== +=== +== += + +Bei der Eingabe einer geraden Zahl, soll der Benutzer auf eine falsche Eingabe hingewiesen werden. + +Boilerplate: pyramid.py diff --git a/aufgabe2/guessme.py b/aufgabe2/guessme.py new file mode 100755 index 0000000000000000000000000000000000000000..14a2eb6d6525246a5f4ba4a2fe269f4f03b6991f --- /dev/null +++ b/aufgabe2/guessme.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + + +import random + + +def get_random_word(): + + words = [ + 'mammoth', + 'stay', + 'improve', + 'zealous', + 'day', + 'foregoing', + 'hilarious', + 'oil', + 'doubtful', + 'brush', + 'impolite', + 'birthday'] + + return random.choice(words) diff --git a/aufgabe2/pyramid.py b/aufgabe2/pyramid.py new file mode 100755 index 0000000000000000000000000000000000000000..bf6d958b15b5eb07db9cee28dd8fb10bce4c0b11 --- /dev/null +++ b/aufgabe2/pyramid.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + + +import sys + + +def draw_pyramid(n): + pass + +def main(args): + + try: + height = int(args[0]) + draw_pyramid(height) + except Exception as e: + print('Please specify pyramid height') + print(e) + +if __name__ == '__main__': + + args = sys.argv[1:] + main(args)