Created
November 24, 2019 09:59
-
-
Save LittleHaku/10f2d19ee1e9083911300a890f4d285d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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