python print 格式化字符串 輸出内容True或False的變量用什麽
要在格式化字符串中输出True或False的变量,可以使用占位符%s来表示变量的字符串表示形式。例如:
my_bool = True
print("The value of my_bool is %s" % my_bool)
# 输出:The value of my_bool is True
原文地址: https://www.cveoy.top/t/topic/inoL 著作权归作者所有。请勿转载和采集!