小编Mon*_*der的帖子

AttributeError:'NoneType'对象没有属性'format'

print ("Hello World")
print ("{} World").format(Hello)
Run Code Online (Sandbox Code Playgroud)

我正在开发我的第一个"Hello World"程序,我可以通过使用print函数和一个简单的字符串文本来实现.format它,但是当我尝试使用它时,给出了错误:

AttributeError: 'NoneType' object has no attribute 'format' 
Run Code Online (Sandbox Code Playgroud)

这是说我需要初始化一个变量,.format或者我错过了什么?

python string python-3.x

14
推荐指数
1
解决办法
3万
查看次数

标签 统计

python ×1

python-3.x ×1

string ×1