DEV Community

Discussion on: DAY 6: REVIEW

Collapse
 
muhimen123 profile image
Muhimen

Python is well known for its simplicity. This will work the same.

even = ''.join([string[i] for i in range(0, len(string), 2)])
odd = ''.join([string[i] for i in range(1, len(string), 2)])
Collapse
 
idimaimuna profile image
M__

That's really nice. Thanks