Q:

Write a Python program to split a list every Nth element

0

Write a Python program to split a list every Nth element.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

C = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n']
def list_slice(S, step):
    return [S[i::step] for i in range(step)]
print(list_slice(C,3))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now