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或者我错过了什么?