def string_splosion(str):
result = ""
for i in range(len(str)):
result = result + str[:i + 1]
return result
I got this answer from codingBat. Can someone explain this code to me? I am having trouble understanding what the :i + 1 does in str{0:i + 1] code. Thanks
Tried multitiude of things to solve the problem. But keep getting it wrong.