我知道我做不到:
"%b %b" % (True, False)
在 Python 中。我猜 %b 是 b(oolean)。有这样的吗?
%b
最佳答案
>>> print "%r, %r" % (True, False) True, False
这并不特定于 boolean 值 - %r 调用参数的 __repr__ 方法。 %s(对于 str)也应该可以工作。
%r
__repr__
%s
str
https://stackoverflow.com/questions/2259228/
相关文章:
python - 在类方法上使用 property()
Linux - 替换文件名中的空格
android - Ubuntu - 错误 : Failed to create the SD ca
python - 定义Python源代码编码的正确方法
linux - 如何从文本文件中删除换行符?
linux - 安装 Jenkins 后无法 su 到用户 jenkins
linux - 并排显示两个文件
python - 导入语句python3的变化
linux - 错误 : Can't open display: (null) when using
python - 在pytest中,conftest.py文件有什么用?