Friday, January 28, 2022

Mumbling Codewars Python

def accum(s):
    new = []
    for i, a in enumerate(s):
        new.append(a.upper() + a.lower()*(i))
    return '-'.join(new)

 

Learnt about enumerate here



Related Posts


No comments :

Post a Comment