热线电话:13121318867

登录
2019-01-17 阅读量: 617
变量的语法错误(一)

变量或者函数名拼写错误(导致“NameError: name 'fooba' is not defined”)

该错误发生在如下代码中:

foobar = 'Al'
print('My name is ' + fooba)

或者:

spam = ruond(4.2)

或者:

spam = Round(4.2)

在写代码的过程中,初学者容易犯的错误是变量的拼写错误。

在定义一个变量之后,可以运用tab键补全。避免犯拼写错误

0.0000
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子