[Solved] How to make a substring pyramid psuedocode with words on Python? [closed]


You were almost there

s = "hello"

out = ""
for letter in s:
    out += letter
    print(out)

for letter in out:
    out = out[:-1]
    print(out)

Output:

h
he
hel
hell
hello
hell
hel
he
h

solved How to make a substring pyramid psuedocode with words on Python? [closed]