<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def assignIfExists(opts, default=None, **kwargs):
 """ Helper for assigning object attributes from API responses. """

    for opt in opts:
        if(opt in kwargs):
            return kwargs[opt]
    return default