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

Stop, Code, and Understand! SCU 3.5 Tuple Operations

Оглавление

Download the file “SCU 3_5.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 Python code where indicated to print out the number of times the value 3 is in the tuple. 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 tuples, which are immutable sequences. Tuples have important usages when we have sequences of elements that we do not want to change.

Introduction to Python Programming for Business and Social Science Applications

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