![]() |
Error TypeError: '<=' not supported between instances of 'int' and 'NoneType' - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Error TypeError: '<=' not supported between instances of 'int' and 'NoneType' (/thread-10034.html) |
Error TypeError: '<=' not supported between instances of 'int' and 'NoneType' - kaledhananjay - May-10-2018 Hello, I am new to python and working on the creating client of websocket API. In One function I am getting the error [b]if 3000 <= code < 4000: the complete error is ********************* *********************How can I fix this? Thanks and regards Dhananjay Kale RE: Error TypeError: '<=' not supported between instances of 'int' and 'NoneType' - j.crater - May-10-2018 Hi, next time please use proper tags for formating the post, you can find help here. The error message suggests that the code variable holds a None value, which obviously cannot be compared to a number. So check the rest of your program to find how code becomes None. It could be you intended to assign code a result of a function with no return statement. By default functions return None. If you are unsure, post the rest of your code in Python code tags. |