Python Setiap orang masuk ke daftar
a = [1, 2, 3, 4, 5]
a[1::2]
# returns 2, 4
a[::2]
#returns 1, 3, 5
EDestroyer
a = [1, 2, 3, 4, 5]
a[1::2]
# returns 2, 4
a[::2]
#returns 1, 3, 5
import numpy as np
values=np.arange(0,10)
print(values[::2])
def altElement(a):
return a[::2]