@Hornbydd is correct and that answer should be accepted. That's the error we get with Python 2 if we try to add two values and one is None
.
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "message" + None
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'NoneType' objects
With Python 3 we also get a TypeError but the message has changed.
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "message" + None
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Can't convert 'NoneType' object to str implicitly