<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hash(symbol, hash_type='sha1'):
 """ create a hash code from symbol """

    code = hashlib.new(hash_type)
    code.update(str(symbol).encode('utf-8'))
    return code.hexdigest()