Search a list: Difference between revisions

(→‎{{header|Python}}: Raw exception output.)
Line 507:
<ruby>haystack=["Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"]
 
for needle in ["Washington","Bush"].each { |needle|do
if (i = haystack.index(needle))
print i, " ", needle, "\n"
Line 513:
print needle, " is not in haystack\n"
end
}end</ruby>
Output:
<pre>
Anonymous user