非空即真

非空即真,非0即真 可以简化自己的代码 None {} () [] '' 这些都是False 非空就是True username = input('username:') if username.strip(): #不为空 print('你输入的不为空',username) else: print(
posted @ 2021-07-16 16:20  灿烂初秋  阅读(31)  评论(0编辑  收藏  举报