What is a 'NoneType' object?

前端 未结 9 1366
南笙
南笙 2020-11-28 03:12

I\'m getting this error when I run my python script:

TypeError: cannot concatenate \'str\' and \'NoneType\' objects

I\'m pretty sure the \'

9条回答
  •  时光取名叫无心
    2020-11-28 03:53

    Your error's occurring due to something like this:
    >>> None + "hello world"
    Traceback (most recent call last):
    File "", line 1, in
    TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
    >>>

    Python's None object is roughly equivalent to null, nil, etc. in other languages.

提交回复
热议问题