Does not import standard library modules of python?

I wanted to use the pickle module. Prior to that, he worked now when I try to run the following code
l = [1,2,3,4]
x = 48

import pickle

f = open('data.bt', 'wb')
lis = pickle.dump(l, f)
num = pickle.dump(x, f)
f.close()

of = open('data.bt', 'rb')
load = pickle.load(z)
print(load)


Climbs error
# ImportError: cannot import name 'FunctionType' from 'types'


By the way same thing with the random module, only changes to FunctionType MethodType
# ImportError: cannot import name 'MethodType' from 'types'


I tried to understand the translation but I don't understand. Help
March 23rd 20 at 19:28
1 answer
March 23rd 20 at 19:30
You load a pickle file ofand of an unknown variable z. Either the question is incorrect, or it is incomplete.

Find more questions by tags Python