from cryptography.fernet import Fernet def encrdecr(keyval, textencr, textdecr): # Write your code here key = keyval # key = Fernet.generate_key() f = Fernet(key) result = [] result.append(f.encrypt(textencr)) result.append(f.decrypt(textdecr).decode()) # python去除 b' return(result)