Report Bug

Qus

Which syntax would print every other item from the array below:

arr = np.array([1,2,3,4,5,6,7])
Qus

कौन सा सिंटैक्स नीचे दिए गए सरणी से हर दूसरे आइटम को प्रिंट करेगा:

arr = np.array([1,2,3,4,5,6,7])


A. print(arr[1:3:5:7])
B. print(arr[::2])
C. print(arr(0:step=2))
D. print(arr[2:2:2])


Solution
B. print(arr[::2])



CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad