美文网首页
python常见错误

python常见错误

作者: FannyChung | 来源:发表于2014-07-22 23:25 被阅读0次

拼写

拼写变量、自定义函数错误

start_point拼写成start-point或缺少、增加字母等。

拼写关键字错误

print缺少字母变成prin、除号拼写成了/

拼写库函数错误

pop拼写成poop

赋值与相等符号混用

缩进

有了错误的缩进:


print_irst_and_last(sentence)

print_first_a_last_sorted(senence)

导入相关

如果已经import ex25则每次执行里面的函数都要ex25.printfirst()

如果已经from ex25 import *,则每次执行函数都不能加ex25:printfirst()``

.

相关文章

网友评论

      本文标题:python常见错误

      本文链接:https://www.haomeiwen.com/subject/phmstttx.html