import random verbs = ["springt", "läuft", "spielt", "kreischt", "tunrt"] nouns = ["Miriam", "Der Junge", "Das Kindermädchen", "Mein Bauch", "Das Kleinkind"] parts = ["im Freien", "glücklich", "auf den Wolken", "im Auto", "in der Sporthalle"] example = ["morgens", "nachts", "übermorgen", "im Sommer", "nach dem Essen"] def returnRandomElement(array): zufallszahl = random.randint(0,len(array)-1) return array[zufallszahl] def makeOutput(verbs, nouns, parts, example, isQuestion): if not isQuestion: print(returnRandomElement(nouns)+' '+returnRandomElement(verbs)+' '+returnRandomElement(example)+' '+returnRandomElement(parts)+'.') else: print(returnRandomElement(verbs)+' '+returnRandomElement(example)+' '+returnRandomElement(nouns)+' '+returnRandomElement(parts)+'?') for i in range(15): makeOutput(verbs, nouns, parts, example, False) print() for i in range(3): makeOutput(verbs, nouns, parts, example, True)