← back to unit
Easy
# searching easy
Where's My Backpack?
The cubby wall at school is one long row, and every cubby holds one thing. 🎒
You get a list of items and your backpack is in there somewhere. Print which cubby it's in — but cubbies are numbered starting from 1, not 0!
Example:
Input: items = ["lunchbox", "coat", "backpack", "ball"]
Output: 3
backpack sits at index 2 (the third position), but cubbies count from 1, so we print 2 + 1 = 3.
💡 need a hint?
srch-wheres-backpack.py🔒 given lines are locked — write your code in between
loading...