Читать книгу Introduction to Python Programming for Business and Social Science Applications - Frederick Kaefer - Страница 92

Stop, Code, and Understand! SCU 3.7 Dictionary Operations

Оглавление

Download the file “SCU 3_7.py” from the companion website and save it either on your computer or on a removable storage device. Open the file in the Python IDLE editor and modify the indicated line of code to print just the list of the values in the dictionary using the .values() method. Execute the modified program after the change to verify that the revised code runs and produces the correct result.

Description

Lessons learned: In this section, we learned what a dictionary is and how we can define one. We also learned about a number of operations that are used to work with dictionaries to do things like returning information corresponding to a dictionary entry or adding or changing a dictionary entry.

Introduction to Python Programming for Business and Social Science Applications

Подняться наверх