Python 中空字符串用于条件表达式的方法

来源:互联网 发布:金棕榈 软件 编辑:程序博客网 时间:2024/05/17 22:25
import strings = ''if s is None:  print('\'\' == None')else:  print('\'\' != None')if not s:  print('\'\' == False')else:  print('\'\' != False')if s == False:  print('Can use \'\' == False')else:  print('Can not use \'\' == False')



原创粉丝点击