Jan-14-2019, 03:48 PM
numbers = [1, 2, 3,[4,5,6]]` for i in numbers:` if isinstance(i,list):` `print("YES")` else: print("NO")`1. when 1 = 1 , why it ins't an instance of list ? It is a nested list and 1 is definitely an element of outer list.
2. When i becomes 4 , output is YES. It is an inner list so why the same logic was not implemented for when i = 1.