Skip to content

Instantly share code, notes, and snippets.

@LittleHaku
Created November 24, 2019 09:59
Show Gist options
  • Select an option

  • Save LittleHaku/10f2d19ee1e9083911300a890f4d285d to your computer and use it in GitHub Desktop.

Select an option

Save LittleHaku/10f2d19ee1e9083911300a890f4d285d to your computer and use it in GitHub Desktop.
def accum(s):
final = ""
n = 0
length = len(s)
for letter in s:
final += letter.upper() + letter.lower() * n
if length > 1:
final += "-"
n += 1
length -= 1
return final
print(accum("ZpglnRxqenU"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment