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

Stop, Code, and Understand! SCU 3.2 Use a List Method

Оглавление

Download the file “SCU 3_2.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 add a line of code to append the value 21 to this list using a list method. Execute the modified program after the change to verify that the revised code runs and produces the correct result.


Lessons learned: In this section, we learned about lists that enable us to store multiple values of different data types in the same variable and that each item in a list can be referenced using an index value. We also learned about list methods, which are actions that can be performed to or with lists. Lists are very useful when working with data sets that are made up of different types of data.

Introduction to Python Programming for Business and Social Science Applications

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