I am trying to take a string and print a descending triangle that removes one character until there are no characters left. For example if "hello" was inputed this would be the output:
hello hell hel he h
I am supposed to do it with both using with two separate functions, one using iteration and the other recursion so it outputs the triangle twice. This is what I have so far but I don't think it's very close.
for i in range(len(text)): print(text[i:-1])
I also tried this but it just takes the entire string
for i in range(len(text), 0, -1): for j in range(0,i): print(text, end="") print()