3

Artificial Intelligence

Unit 3: Advance Python

255+ practice questions available

Sample Practice Questions

5 questions shown — tap “Show Answer” to check yours.

1
medium

What does np.eye(3) produce?

AA 3x3 array of all ones
BA 3x3 identity matrix
CA 1D array [0, 1, 2]
DA 3x3 array of random values
2
medium

What is requirements.txt used for?

AListing Python syntax requirements
BListing project dependencies with their versions for reproducibility
CStoring test cases
DConfiguration settings
3
hard

What does groupby().agg({'col1': 'sum', 'col2': 'mean'}) do in pandas?

AGroups by col1 and col2
BApplies different aggregation functions to different columns simultaneously
CCreates new columns col1 and col2
DFilters rows based on aggregation conditions
4
hard

What does functools.lru_cache do?

ALoads the most recently used cache
BCaches (memoizes) function results so repeated calls with same arguments return cached values
CLimits the size of a function's return value
DCaches imported module results
5
hard

What is structural pattern matching (match/case) in Python 3.10+?

AA regex-based string matching feature
BA control flow structure that matches the shape/structure of objects against patterns
CA way to match class methods
DA switch statement equivalent only for integers

Practice all 255+ Unit 3: Advance Python questions

Adaptive difficulty, instant explanations, XP rewards, chapter mastery tracking.

Start Free — No Credit Card →