कैसे करने के लिए फार्म का एक शब्दकोश फ़ाइल और गुण में अजगर
कोड उदाहरण
0
0
कैसे बनाने के लिए एक शब्दकोश से एक फ़ाइल py
dictionary = {}
file = open("data.txt")
for line in file:
key, value = line. split() # Split line into a tuple.
dictionary[key] = value # Add tuple values to dictionary.
print(dictionary)