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:
Sunil Shaw

Sunil Shaw

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