Demo entry 6733009

monokai

   

Submitted by anonymous on Apr 16, 2018 at 13:50
Language: Python 3. Code size: 226 Bytes.

animal = ['cat', 'snake', 'monkey', 'ant', 'spider'] 
legs= [4, 0, 2, 4, 8]
animal_legs_dict = {}
for i in range(len(animal)):
    animal_legs_dict[legs[i]] = animal[i]
animal_legs_dict['ant'] = 6
print(animal_legs_dict)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).