为什么name = Alice 会报错?
提前谢谢各位大佬!
代码如下:
name = Alice
Traceback (most recent call last):
File "<pyshell#56>", line 1, in <module>
name = Alice
NameError: name 'Alice' is not defined. Did you mean: 'slice'? 要加双引号才是字符串,不加双引号是变量名,你引用了未被定义的变量肯定是会报错的
name = "Alice" isdkz 发表于 2024-8-5 16:39
要加双引号才是字符串,不加双引号是变量名,你引用了未被定义的变量肯定是会报错的
好的,非常感谢
页:
[1]