You can use slices:
s="abcde"
for i in range(len(s), 0, -1):
print(s[:i])
2
solved How to remove each element from a string in python?
You can use slices:
s="abcde"
for i in range(len(s), 0, -1):
print(s[:i])
2
solved How to remove each element from a string in python?