मेरे कार्यक्रम लग रहा हैपायथन: AttributeError: 'NoneType' ऑब्जेक्ट कोई गुण नहीं है 'संलग्न'
तरह# global
item_to_bucket_list_map = {}
def fill_item_bucket_map(items, buckets):
global item_to_bucket_list_map
for i in range(1, items + 1):
j = 1
while i * j <= buckets:
if j == 1:
item_to_bucket_list_map[i] = [j]
else:
item_to_bucket_list_map[i] = (item_to_bucket_list_map.get(i)).append(j)
j += 1
print "Item=%s, bucket=%s" % (i, item_to_bucket_list_map.get(i))
if __name__ == "__main__":
buckets = 100
items = 100
fill_item_bucket_map(items, buckets)
जब मैं इस चलाने के लिए, यह मुझे फेंकता
AttributeError: 'NoneType' object has no attribute 'append'
सुनिश्चित नहीं हैं कि क्यों यह होगा होता है? जब मैं पहले से ही प्रत्येक j
संभव डुप्लिकेट [अजगर TkInter - AttributeError: 'NoneType' ऑब्जेक्ट कोई विशेषता 'प्राप्त' है] (http://stackoverflow.com/questions/1101750/python-tkinter-attributeerror-nonetype-object-has- नो-एट्रिब्यूट-प्राप्त) – UpAndAdam