RosettaCodeData/Task/Search-a-list/Lua/search-a-list.lua

8 lines
208 B
Lua
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
list = {"mouse", "hat", "cup", "deodorant", "television", "soap", "methamphetamine", "severed cat heads"} --contents of my desk
item = io.read()
for i,v in ipairs(list)
if v == item then print(i) end
end