From the course: Programming Foundations: Beyond the Fundamentals
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Creating more complex collections - Python Tutorial
From the course: Programming Foundations: Beyond the Fundamentals
Creating more complex collections
- Sometimes simply grouping data doesn't meet my organizing needs. For instance, say I've organized all my papers for a project into stacks, receipts, correspondence, and forms. Without a label, it can be hard to remember what's in which pile, and I certainly just can't stack it all up together without losing my organization. With papers, I can use a system like hanging file folders and I can indicate the category on the file folder tab. When I'm done with the box, I have all the documents grouped and labeled for easy access, but stored within a single project, like my papers, related data in my program sometimes needs a more complex approach to organization as well. Many programming languages support a rich collection type that lets you store related information but with a label for each item. In Python, the dictionary data type serves this function. To create a dictionary, I specify a variable name and close the value…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Understanding collections2m 31s
-
(Locked)
Creating simple collections3m 16s
-
(Locked)
Creating more complex collections3m 22s
-
(Locked)
Working with collections3m 24s
-
(Locked)
Collections in other languages2m 3s
-
(Locked)
Challenge: Working with a collection1m 3s
-
(Locked)
Solution: Working with a collection5m 26s
-
-
-
-
-
-
-
-
-
-
-