← back to unit
Medium
# searching medium
Count Until You Find It
You're digging through the toy chest for your dinosaur, tossing toys aside as you go. 🦕
You get a list of toys and the dinosaur is definitely in there. Print how many toys you toss aside BEFORE you reach dino.
Example:
Input: toys = ["ball", "car", "dino", "doll"]
Output: 2
"ball" and "car" get tossed aside before reaching "dino" — that's 2 toys tossed.
💡 need a hint?
srch-count-until-found.py🔒 given lines are locked — write your code in between
loading...