forked from makersacademy/intro-to-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
029_lists.py
35 lines (23 loc) · 948 Bytes
/
029_lists.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Video alternative: https://vimeo.com/954334163/bf61706e77#t=1027
# When looking at strings, I mentioned the concept of data
# structures.
# To remind you, a data structure is a collection of data
# organised in a certain way. A string is a sequence of
# characters.
# We're now going to look at another kind — the list. A list
# is a sequence of items, and those items can be of any
# type.
# Here's are two examples:
my_favourite_numbers = [1, 3, 5, 7, 9]
my_friends = ["Victoria", "Mel", "Melanie", "Emma"]
# Notice how the square brackets `[` and `]` tell Python
# that this is a list, and how the commas separate the items
# in the list.
# It's common to forget these commas so add it to your list
# of things to check when your code doesn't work.
# @TASK Try making your own here:
your_list = ...
print(your_list)
# @TASK and print it out by running:
# python 029_lists.py
# When you're done, move on to 030_list_indexing.py