Daily #32 · 30 October 2026
Finding nothing Hard
What does this print?
s = "hello"
i = s.find("z")
print(s[i])
Show the answer
B: o
Why: find returns -1 when the text is not there, and -1 is a valid index: the last character. No error is raised. Check if i != -1 first, or use index, which raises ValueError instead.