dailyprogrammer 391
This commit is contained in:
parent
96fcc4ab8b
commit
853618c8bb
2 changed files with 17 additions and 0 deletions
14
python/dailyprogrammer/#391 - ABACABA.py
Normal file
14
python/dailyprogrammer/#391 - ABACABA.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from string import ascii_lowercase
|
||||
|
||||
def abacaba(n):
|
||||
output = ''
|
||||
currLetter = 0
|
||||
for i in range(n):
|
||||
output = '{0}{1}{2}'.format(output, ascii_lowercase[currLetter], output)
|
||||
currLetter = currLetter + 1
|
||||
if currLetter > 25:
|
||||
currLetter = 0
|
||||
return output
|
||||
|
||||
out = abacaba(10)
|
||||
print(out)
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
[The Subreddit](https://reddit.com/r/dailyprogrammer)
|
||||
|
||||
- #391 - ABACABA
|
||||
- [Solution](%23391%20-%20ABACABA.py)
|
||||
- [Reddit Post](https://www.reddit.com/r/dailyprogrammer/comments/njxq95/20210524_challenge_391_easy_the_abacaba_sequence/)
|
||||
- #393 - Making Change
|
||||
- [Solution](%23393%20-%20Making%20Change.py)
|
||||
- [Reddit Post](https://www.reddit.com/r/dailyprogrammer/comments/nucsik/20210607_challenge_393_easy_making_change/)
|
||||
|
|
Loading…
Reference in a new issue