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
Use isinstance:
if isinstance(e, list):
If you want to check that an object is a list or a tuple, pass several classes to isinstance:
isinstance
if isinstance(e, (list, tuple)):