• python --error整理(不定时更新)


    1.TabError: inconsistent use of tabs and spaces in indentation

     Python 中需要用tab 键来空格

    2.SyntaxError: invalid character in identifier

    中英文没有切换好

    3.TabError: inconsistent use of tabs and spaces in indentation

    空格问题;;

    4.name.login_attempts()

    TypeError: 'int' object is not callable

    调用int时出错:需要重新定义变量名

    5. IndentationError: expected an indented block

    在定义类之后没有再定义了

    6. super().__init__(make, module, year)

    TypeError: object.__init__() takes no arguments

    继承error

    class ElectricCar(Car)括号内的car没有写,所以出现了takes no arguments 的错误。

    7. IndentationError: unexpected indent

    没有缩进,把空格去掉。

    8.SyntaxError: invalid character in identifier, 

    一直找不到问题点的话,请确保代码行内没有夹杂中文的空格,tab等,非文字字符

    9. can't find '__main__' module in ''

    没有先保存,我是在sublime text中执行的,忘记先保存再运行,因此报了这样的错

  • 相关阅读:
    HashTable、HashSet和Dictionary的区别
    CCF_ 201312-3_最大的矩形
    CCF_ 201312-2_ISBN号码
    CCF_201312-1_出现次数最多的数
    CCF_ 201509-2_日期计算
    CCF_ 201512-3_画图
    CCF_ 201512-2_消除类游戏
    CCF_ 201409-2_画图
    CCF_201409-1_相邻数对
    CCF_ 201412-1_门禁系统
  • 原文地址:https://www.cnblogs.com/clairedandan/p/10848485.html
Copyright © 2020-2023  润新知