<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _python_installed(ret, python, user=None):
    '''
    Check to see if given python is installed.
    '''
    default = __salt__['pyenv.default'](runas=user)
    for version in __salt__['pyenv.versions'](user):
        if version == python:
            ret['result'] = True
            ret['comment'] = 'Requested python exists.'
            ret['default'] = default == python
            break

    return ret