1. 使用 `len()` 函数:
```python
my_set = set()
if len(my_set) == 0:
print("集合为空")
else:
print("集合不为空")
2. 使用 `not` 关键字:
```python
my_set = set()
if not my_set:
print("集合为空")
else:
print("集合不为空")
以上两种方法都可以用来判断集合是否为空。使用 `len()` 函数是最直接的方法,而使用 `not` 关键字则更为简洁