iNTERFACEWARE Products Manual > Learning Center > Learning Python > Lists > Assignment from Lists |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
Python provides many ways to use lists to assign values to variables. For instance, you can assign an entire list to a variable:
You can access an individual element of a list by specifying its index:
Like lists, indexes are enclosed in brackets ([]). In this example, the element of PatientInfo at index 1 is referenced.
You can also assign to multiple variables at once from a single list:
This assigns JohnDoe to patientname, 42446 to patientid, and Admitted to patientstatus. |