sandiegopython / intro-to-python

Introduction to Python (2014)
Creative Commons Attribution 4.0 International
28 stars 26 forks source link

Reduce number of division examples #29

Closed treyhunner closed 10 years ago

treyhunner commented 10 years ago

Currently we show 5 examples of division in part 1. We did this originally to show the difference between integer/float division. In Python 3 all division results in a float, so I think we can reduce the number of examples.

Currently we have:

4 / 2 1 / 2 3 / 2 15 / 2 1.0 / 2

Maybe we should change this to just a couple. I propose:

4 / 2 3 / 2

alaindomissy commented 10 years ago

yes

treyhunner commented 10 years ago

Actually under "Variables" we also show:

cups_of_flour = 5
cups_of_flour * .5
1 / 2
1.0 / 2

and it says "two different data types" and then shows the type function.

I think we should change the variables part to just cups_of_flour / 2 and leave out the next two lines (since they're equivalent).

Showing the two different number types seems fine, but I'm not sure it's necessary.

alaindomissy commented 10 years ago

when we introduce the notion of type: should we have examples to explain the following:

treyhunner commented 10 years ago

@alaindomissy I think we go over your first point pretty well.

We actually use type many times throughout part 1 and we do show concatenation between strings and numbers:

"Hello" + 1
"Hello" + "1"
type(1)
type("1")
"Hello" + str(1)

As for your second point, I vote for answering that question if it comes up but not specifically noting it in the curriculum. I vote for that because that might confuse those not familiar with strictly-typed programming languages already.

macro1 commented 10 years ago

Agree with not mentioning differences with other languages unless asked. Analogies are only as good as your target audience's knowledge of them.

willingc commented 10 years ago

+1 to all comments. I plan to work late afternoon until late this evening on the workshop. If this is still open then, I will make changes to the notebook :)

willingc commented 10 years ago

Closing this issue. PR #37 addresses this issue. :cookie: