5.1.1.4. Is it empty? Stacks

I am having issues with this problem somehow.

The question is:
Create a function called is_empty() . This function’s task is to check whether or not there are more elements left inside the stack.

  1. Create a function called is_empty()
  2. It should take one argument called stack
  3. return the boolean True if and only if the stack is empty.

My code is:

def is_empty(stack):
if is_empty == []:
return True

What am I doing wrong?
url is https://nt.dev/s/dc0d4ec65dfb

Thanks
James

This post was flagged by the community and is temporarily hidden.

1 Like