Write a function that finds a list is homogeneous


Topic: Write a function that finds a list is homogeneous

Solution

def homoList(li):
  res = True
  for i in li: 
      if not isinstance(i, type(li[0])): 
          res = False 
          break
  return res



List all Python Programs