Tuple

Ha Khanh Nguyen (hknguyen)


1. Tuple


2. Elements of a Tuple


3. Tuple Concatenation


4. Unpacking Tuples


5. count()


Exercise

Some students' information is stored in a nested tuple where each inner tuple represents a student.

For each inner tuple, the information is stored in the following format (name, age, is female?).

Unpack this tuple and store all students name in a string (separated by comma ,), and all students' ages together and count the number of female and male students (store them in female_count and male_count).


This lecture note is modified from Chapter 3 of Wes McKinney's Python for Data Analysis 2nd Ed.