🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

pickle module क्या करता है?

What does the pickle module do in Python?

A
Encrypt data
B
Save images
C
Serialize and deserialize Python objects
D
Sort lists
Explanation

The pickle module in Python is used to serialize (convert to byte stream) and deserialize (reconstruct from byte stream) Python objects. This is useful for saving objects to a file or sending them over a network.

📌 Example:

 
import pickle data = {'a': 1, 'b': 2}
with open('data.pkl', 'wb') as f:
pickle.dump(data, f) # Serialize
with open('data.pkl', 'rb') as f:
loaded_data = pickle.load(f) # Deserialize

हिंदी में:

Python में pickle module का उपयोग Python objects को serialize (byte stream में बदलना) और deserialize (byte stream से वापस object बनाना) करने के लिए किया जाता है। इसका उपयोग डेटा को फाइल में सुरक्षित रखने या नेटवर्क पर भेजने के लिए किया जाता है।

Correct Answer: C) Serialize and deserialize Python objects

Latest Updates