Write a Python program to check if a list is empty or not

def func(lst):
    if lst == []:
        return "list is empty"
    else:
        return "list is not empty"



print(func(['abc', '11', 'xyz', 'aba', '1221', '2112', 'xyz', '11', 'aba']))

print(func([]))


Follow on:
  • Twitter
  • Facebook
  • Instagram
  • Linkedin
  • Linkedin
Sunil Shaw

Sunil Shaw

  • Youtube
  • Instagram
  • Twitter
  • Facebook
About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Page