From the course: Python Quick Start
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Defining sequences - Python Tutorial
From the course: Python Quick Start
Defining sequences
When you're programming, you'll often need to store some data to use throughout your program. That could be individual pieces of data and collections of data. To store an individual piece of data, say the name of a person, you could do something like this. In this cell, I've created a variable called "name," and I've assigned it the value of "Brad" in quotes. Now, to store a collection of data, say a group of people's names, you could do something like this. And in this cell here, I've created a variable named group, and I've assigned it to the list of names that you see here. Both name and group are variables, but each store a different type of data. Name stores a string, while group stores a list. A list is a kind of sequence, and a sequence is a collection of data. Here, Daniel, Habiba, Gloria, Eric, Sahar, and Marvin are each an individual piece of data. In fact, they are each a string and the variable group stores all those strings in one place as a sequence. So whenever I need…
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.