from typing import OrderedDict


def getAttrFromList(objList, attr):
    """\
Given a list of objects in objList, each having the attribute attr, return a list comprising the value of attr for each object in objList.

Return: A list of values.

Parameters:
  * objList: The list of objects
  * attr: The attribute had in common
"""

    values = []
    for o in objList:
        if type(o) == dict or type(o) == OrderedDict:
            values.append(o.get(attr, None))
        else:
            values.append(getattr(o, attr))
    return values