最佳答案
有没有一种方法可以将 unicode
类型的 true
转换为1,将 unicode
类型的 false
转换为0(在 Python 中) ?
例如: x == 'true' and type(x) == unicode
我要 x = 1
附注: 我不想使用 if
-else
。