Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. 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