Answers for "python check set empty"

1

how to check a set is empty in python

s = set()
if len(s) == 0:
  print('Empty')
else:
  print('Not empty')
Posted by: Guest on June-06-2021
-2

python check set empty

set_variable == set() # return True if set_variable is an empty set
Posted by: Guest on December-09-2020

Python Answers by Framework

Browse Popular Code Answers by Language