<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def attr(obj, attr):
 """ Does the same thing as getattr. getattr(obj, attr, '') """

    if not obj or not hasattr(obj, attr):
        return ''

    return getattr(obj, attr, '')