- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
AI & Machine Learning NumPy Arrays Quiz
This quiz checks the NumPy basics every data science and machine learning workflow uses. You will predict the output of short snippets that create, index, slice, filter and reshape arrays, and spot the one that fails.
Sample question
Question 1 of 10What does this print?
import numpy as np
a = np.array([1, 2, 3])
print((a * 2).tolist())
Show the answer
B. [2, 4, 6] NumPy applies * 2 to every element, so you get [2, 4, 6]. Repeating the items, [1, 2, 3, 1, 2, 3], is what * does to a plain Python list.
What this quiz covers
- Element-wise math on arrays vs lists
shape,dtypeandreshape()- Indexing, slicing and boolean masks
- Slices are views, not copies
- Summing along an axis
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.