split python strings into pairs 26 complete uneven pairs

Solutions on MaxInterview for split python strings into pairs 26 complete uneven pairs by the best coders in the world

showing results for - "split python strings into pairs 26 complete uneven pairs"
Fynn
11 Jun 2018
1>>> s = "abcde"
2>>> k = 2
3>>> [s[i:i+k].ljust(k, "_") for i in range(0, len(s), k)]
4['ab', 'cd', 'e_']
5