【发布时间】:2016-07-14 12:39:44
【问题描述】:
d = 8.6
print '%1.0f' %(d)
显示错误'd' is not defined
我正在使用 jupyter 笔记本。
使用代码
print '%1.0f' %(8.6)
给出正确的值。但是,它不能识别 'd' 对象
【问题讨论】:
-
它对我来说很完美。你确定你没有打错什么吗?
-
我也无法使用给定的代码示例重现此问题。我在自己的行上输入
%(d)时得到ERROR: Line magic function `%(d)` not found.。
标签: python-2.7 jupyter-notebook magic-function