def triangleWord() : word = input("enter a long word: ") for i in range(len(word)+1) : print(word[0:i]) def trapezoidWord() : word = input("enter a long word: ") start = int(input("how long should the first substring be?: ")) end = int(input("how long should the last substring be?: ")) if end > len(word) : print("the word isn't that long! going up to maximum: ", len(word)) end = len(word) for i in range(start, end+1) : print(word[0:i]) triangleWord() print("---------------------") trapezoidWord()