python 判断是否空字符串

方法1:

float(inputStr.strip() or '0')

方法2:

"0" if inputStr=="" else "123"
原文地址:https://www.cnblogs.com/hanjun0612/p/15601688.html