【发布时间】:2017-08-29 06:55:22
【问题描述】:
为什么下面的命令会产生带有断线的输入。似乎断线出现在{} 之后。我之前使用过format 函数,它运行良好。现在发生什么事?
print('true: {}, estimated: {}'.format(number_a, number_b))
true: 3
, estimated: 3
【问题讨论】:
-
type(number_a) -
请您自行打印
number_a。它实际上是一个整数,还是一个带有尾随换行符的字符串?