If we have the following list:
list = ['UMM', 'Uma', ['Ulaster','Ulter']]
If I need to find out if an element in the list is itself a list, what can I replace aValidList in the following code with?
for e in list:
if e == aValidList:
return True
Is there a special import to use? Is there a best way of checking if a variable/element is a list?
list
as variable name because it will shadow the built-inlist()
. (2) What should be the meaning of those round brackets?