Comment

Comment by montebicyclelo

What's the advantage over the following?:

  for i in range(n):
      if search(i) == val:
          break
      raise KeyError("not found")
  found_index = i

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton