Docsity

Python in computer science, Slides of Computer science

Partial preview of the text

Download Python in computer science and more Slides Computer science in PDF only on Docsity!

Extracting Keys In [1]: fruit={"Apple":1@, "Orange" :2@,"Banana™:3@, "Guava" :40} fruit.keys() b Out[1]: dict_keys([‘Apple', ‘Orange’, ‘Banana’, ‘Guava’ ]) Extracting Values In [70]: fruit={"“Apple":10, “Orange”: 2, “Banana” :3@, “Guava” :4@} fruit.values() Out[7@]: dict_values([10, 20, 30, 4@])