I have a method in Python and I only want to accept integers listed or singular, how can I define this?
def autoInt(integers):
assert int(integers)
assert len(integers) > 0
This fails as I cannot have a list. I'm sure it's something easy.
TypeError: int() argument must be a string or a number, not 'list'
Edit: I have been tasked so that this method can ONLY accept integers in a list.