lists and tuples · pythonkid2/python-tutorial@100e26d · GitHub
Skip to content

Commit 100e26d

Browse files
committed
lists and tuples
1 parent bc6c8af commit 100e26d

7 files changed

Lines changed: 276 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions

handy-stuff-strings.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ True
213213
>>>
214214
```
215215

216+
The things in square brackets that the split method gave us and
217+
we gave to the join method were lists. We'll talk more about
218+
them [later](lists-and-tuples.md).
219+
216220
## String formatting
217221

218222
To add a string in the middle of another string, we can do something
@@ -260,9 +264,6 @@ our problem:
260264
`'Hello {}.'.format(name)`. I like to use printf-formatting for simple
261265
things and `.format` when I need more powerful features.
262266

263-
**TODO:** warn readers about formatting tuples, and show experienced
264-
users that dictionaries aren't a problem
265-
266267
```py
267268
>>> "Hello %s." % name
268269
'Hello Akuli.'
@@ -273,7 +274,7 @@ our problem:
273274

274275
In the second example we had `(name, channel, network)` on the right
275276
side of the `%` sign. It was a tuple, and we'll talk more about them
276-
later.
277+
[later](lists-and-tuples.md#tuples).
277278

278279
If we have a variable that may be a tuple we need to wrap it in another
279280
tuple when formatting:

images/differentlist.png

2.65 KB
Loading

images/drawings.odg

4.18 KB
Binary file not shown.

images/people.png

15.4 KB
Loading

images/samelist.png

2.75 KB
Loading

lists-and-tuples.md

Lines changed: 269 additions & 0 deletions

0 commit comments

Comments
 (0)