Project 15: Long Message Finder
Data Engineer
Builds on these lessons
Current Task
Objective
np.where() returns the indices where a condition is true, letting you locate matching elements without a manual loop.
Task: find the indices of every message longer than 100 characters and print them.
index.py
import numpy as np
message_lengths = np.array([50, 200, 30, 500, 80])
long_ones = np.where(message_lengths > 100)
print(long_ones)
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview