✓ Accepted answer
If your table t is a list, then #t is the number of elements in the list.
print(#{})
print(#{"a"})
print(#{"a", "b"})
print(#{"a", "b", "c"})
You can compare the size to one to know if it has more than one element:
print(#{} > 1)
print(#{"a"} > 1)
print(#{"a", "b"} > 1)
print(#{"a", "b", "c"} > 1)
This will only work for lists.
Dictionaries, which use non-whole-number keys, don't get counted by #.
Lists which have nil "holes" in them (like {1, nil, 3}) may or may not count the nils; Lua allows the length of a list like {1, nil, 3} to be either 1 or 3 -- it's better to just not use # on such tables because the result is confusing.