Discuss / Python / 作业1

作业1

Topic source

import hashlib

def login(user, password):

    md5=hashlib.md5()

    md5.update(password.encode('utf-8'))

    a=md5.hexdigest()

    if db[user]==a:

       return True

    else:

       return False


  • 1

Reply