Skip to content

Instantly share code, notes, and snippets.

@rense
Created December 27, 2016 12:33
Show Gist options
  • Save rense/af8fd7c9633fbe1b86311a4567c1e6be to your computer and use it in GitHub Desktop.
Save rense/af8fd7c9633fbe1b86311a4567c1e6be to your computer and use it in GitHub Desktop.
foo = ["foe", "jong", "hai", 'sambal', 'bij']
for x in range(len(foo) + 1):
bar = foo[x:]
while len(bar):
print('.'.join(bar))
_ = bar.pop()
foe.jong.hai.sambal.bij
foe.jong.hai.sambal
foe.jong.hai
foe.jong
foe
jong.hai.sambal.bij
jong.hai.sambal
jong.hai
jong
hai.sambal.bij
hai.sambal
hai
sambal.bij
sambal
bij
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment