Sample output
Please type in a string: test
t
st
est
test
i have been trying to do the method of using i=i-1 where the square brackets contain [i:i-1]
input_str1 = input(“Please type in a string: “)
i =len(input_str1)+1
while True:
print(input_str1[i:i-1])
i=i-1
New contributor
NIRANJAN SHASTRY is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.