Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]nth_item = 3str_list = [ '{}\t\n'.format(m) if(((list.index(m) + 1) % nth_item) == 0) else '{}\t'.format(m) for m in list]print('\n'.join(str_list))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement