Answers for "python list take every n element"

1

get every nth element in list python

start_from = 0
every_nth = 2
a_list[start_from::every_nth]
Posted by: Guest on September-11-2020
0

every second value python

import numpy as np
values=np.arange(0,10)
print(values[::2])
Posted by: Guest on March-21-2020

Code answers related to "python list take every n element"

Python Answers by Framework

Browse Popular Code Answers by Language