Python error TypeError: 'nonetype 'object is not iterable solution, typeerroriterable
Python error TypeError: 'nonetype 'object is not iterable Solution
TypeError: 'nonetype 'object is not iterable. This error message generally occurs when None is assigned to multiple values.
Def myprocess (): a = B if! = B: return True, value; flag, val = myprocess ()
In the Judgment statement, when the if condition is not met and there is no else statement, the function returns None by default.
If no return statement exists, Python returns None by default.
When you assign None to multiple values during the call, the following error occurs: TypeError: 'nonetype 'object is not iterable.
In this example, flag and val are both granted with None (because the if condition is not met, the default return of None.
Therefore, the function return value must take into account the coverage of the condition branch.
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!