题解 | 判断列表是否为空

判断列表是否为空

https://www.nowcoder.com/practice/83602ea86f1e4e6ca42d5ebffff34ca8

my_list = []
if bool(my_list):
    print('my_list is not empty!')
else:
    print('my_list is empty!')

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务