الناس تحب البرمجة باستخدام لغة البايثون لانها تساعد على حل أكثر المشاكل 
التي تواجه المطورين والدالة zip() احدى هذه الحلول الني تسهل علينا بعض 
الاشكالات .
cols = ['City','Country','ZipCode']
values = ['Paris','France','12345-12']
zipped = zip(cols ,values)
print zipped #prints [('City','Paris'),('Country','France'),('ZipCode','12345-12')]
dictionary = dict(zipped)#الأن سيتم تحويل القيمة zipped الى قاموس
print dictionary #prints {'City':'Paris','ZipCode','12345-12','Country':'France'}
 
 
 
ليست هناك تعليقات:
إرسال تعليق