DEV Community

loading...

Discussion on: Daily Challenge #210 - Separate Capitalization

Collapse
jhermann profile image
Jürgen Hermann

Any Python version 2.7+.

>>> MiXeD = lambda s: ''.join(x.upper() if i&1==m else x for m in (0,1) for i, x in enumerate(s+' ')).split()
>>> MiXeD('abcdef')
['AbCdEf', 'aBcDeF']

😳 😱

Collapse
muhimen123 profile image
Muhimen

This is the magic of python. Short. I just love it. 💗