2 Comments

Tiny suggestion: in the first instance of the example random_numbers.py, I would replace range(100) with range(1000). That way, when you introduce the comma format specifier in the first print statement, it is actually shown in action.

I realize that the next instance of random_numbers.py uses a much larger number, so that the comma will, this time, appear as a result of printing len(rolls), but still, why not have it show up immediately? Especially as the next two print statement display list slices, which are always displayed with comma separators.

I think this could be a point of confusion for beginning students -- it almost suggests the comma format specifier somehow carries over to the following print statements. And I have to admit, when I looked at this post, before the coffee had kicked in, I was a bit stumped myself, and had that "carries over?" thought, at first.

Expand full comment
author

Thanks Brendan, this is a great suggestion. I'm on a plane at the moment, but I'll update this next time I have a better connection.

Expand full comment