import pickle a = 3; b = [11,223,435]; pickle.dump([a,b], open("trial.p", "wb")) c,d = pickle.load(open("trial.p","rb")) print(c,d) ## To verify