Skip to content

Instantly share code, notes, and snippets.

@Nickikku
Created July 18, 2017 09:56
Show Gist options
  • Save Nickikku/08246d63f8e12272dad47b128692b2f5 to your computer and use it in GitHub Desktop.
Save Nickikku/08246d63f8e12272dad47b128692b2f5 to your computer and use it in GitHub Desktop.
#this function returns lenght of the string number of times of input string. If the string contains 3 characters, it will return
#character 1 + 1, 2 + 1, 2, 3
def string_splosion(str):
a = ''
for i in range(len(str)):
a += str[:(i+1)]
return a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment