Premium problem73. Safe Lookup with a Default

Easy Locked

Return the value of s at label if that label exists in the index, otherwise return the string "Not found" (without raising an error).

Input

s =
a    1
b    2
c    3
dtype: int64
label = 'z'

Output

'Not found'

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)