Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

python books

Name: Anonymous 2010-12-11 9:16

http://greenteapress.com/thinkpython/thinkpython.html

Is this book for python 3 or 2? There are a few footnotes that talk about differences between the two, but I can't figure out which one of them the actual code examples in the book are "compatible" with.

yeah, i don't know shit about programming.

Name: Anonymous 2010-12-11 9:35

2

Name: Anonymous 2010-12-11 12:04

Python books aren't very good.

Best way to learn it is by reading the documentation.

Name: Anonymous 2010-12-11 12:59

>>3

the thing is, I haven't written one line of code before. I doubt I would learn much from just memorizing stuff from a technical reference catalouge. That would be like learning physics out of a data book, i imagine

Name: Anonymous 2010-12-11 13:21

>>4
I see.

In that case, it doesn't matter which version of Python you learn. The differences between 2 and 3 are minimal, and Python 3 adoption is still in its infancy.

If you learn 3, you might have to switch to 2 because of some library. But it'll be easy.

How To Think Like a CS seems like a good book for a beginner.

Name: Anonymous 2010-12-11 14:32

>>4
Even then, give http://docs.python.org/tutorial/introduction.html a try.

It might be somewhat overwhelming for a complete novice to programming in general, and it doesn't teach what programming is about (i.e. how to think about a problem and decompose it into subproblems that you know how to solve) -- but then I have yet to see a book which does.

However there was an interesting study, http://www.google.com/search?num=30&hl=en&safe=off&q=%22The+camel+has+two+humps%22&btnG=Search , which discovered a weird thing completely by accident: the guys were assessing how well the students understand programming after attending some four-week course but accidentally gave the test to the freshmen, most of whom self-reported as having no prior experience with programming.

Now, the original point of the test was that they tried to avoid testing specific knowledge, so instead of questions like "which of sys.out.writeln('zzz') and sys.print('zzz') actually prints 'zzz'?" they had more generic questions about the properties of assignment etc.

What they discovered: a lot of freshmen were able to more or less successfully complete the test. Moreover: looking at the distribution of the results instead of a single Gaussian "hump" they saw something resembling a superposition of two gaussians. What's more: when they repeated the test after the course, aside from generally better results they saw roughly the same two-hump distribution, which correlated very well with the initial result (which was a bit disheartening, since it meant that the course failed to teach programming to everyone).

And the most interesting part: when they examined the answers of the people who had poor results on the first test, but good results on the second, they've noticed a pattern: those students were consistent in their answers on the first test, even if the answers themselves happened to be wrong. I.e. a student might have decided that the assignment "a = 10" works like in math (or in languages like Haskell, where "a" becomes an alias for "10"), and then consistently answered the questions as if that were true. Or the ones who instead decided that the value of "a + 1" changes retroactively when the value of "a" changes.

Most of such students ended up in the upper hump on the second test, after they became accustomed with the conventions which were actually used.

On the other hand, most of the students who did not show an attempt to invent some internal model and stick to it, who just answered "on a hunch", on a per-question basis, obviously ended up in the lower hump on the first test and did not improve much on the second.

The authors' conclusion was that some people (about half of the students they had) exhibit the tendency to analyze questions, produce hypotheses and use them to answer questions consistently (even if wrong). These people make good programmers. The other half which did not exhibit this tendency did not end up learning much about programming during the course (the open question is, how to teach them programming if it is even possible?)

So, to the OP: I'm not saying that if you try to read the official Python tutorial and become completely overwhelmed, you should choose some other profession.


But you definitely should try to read it, keeping in mind that not understanding what exactly is going on is OK as long as you try to have a clear hypothesis of what might be going on (and be ready to replace it with a better hypothesis when it fails).

Name: Anonymous 2010-12-11 14:32

>>5
SICP seems like a good book for a beginner.

FIXED

Name: Anonymous 2010-12-11 14:33

>>4
If you're such beginner, then for the fuck sake, read http://floating-point-gui.de/ before dealing with reals.

Disregarding all of that, python site has decent tutorial and decent problem list if you'll run out of exercises.

Name: Anonymous 2010-12-11 14:55

>>8
Link is full of Jewish lies.

Name: Anonymous 2010-12-11 14:59

>>8
You really shouldn't link to websites that link to xkcd without warning.

Name: Anonymous 2010-12-11 15:05

>>7
SICP is a good book
REVISED3 POST >>5

Name: Anonymous 2010-12-11 15:15

>>10
We don't respect the sensibilities of the people who were raped by rand(all) here, sorry. Learn to live with your trauma.

Also, please, no one should feed >>9 , his agenda is replacing the "jewish" natural numbers with gay numbers.

Name: Anonymous 2010-12-11 15:41

BUMP FOR XKCD!

Name: Anonymous 2010-12-11 15:49

>>13
I liked you better when you were doing that with Xarn.

Name: Anonymous 2010-12-12 4:32

>>6
Interesting, I'll give the tutorial a try. If I fail miserably at it, i'll go with the book. Speaking of which, I haven't had my original question answered, but I'm going to guess it's for python 2, based on >>5.

>>8
I still don't understand why things like 0.1 + 0.2 would be a problem for computers. If working with integers is not a problem, why can't it just calculate 1 + 2 and then move the decimal point one place to the left before presenting the output to the user?

Name: Anonymous 2010-12-12 4:52

>>15
Check out the decimal (or Ratio in Haskell) data type.

Name: Anonymous 2010-12-12 5:36

>>15
They are stored and processed differently, floating point numbers handling is much much more complex.  http://en.wikipedia.org/wiki/IEEE_754

Name: Anonymous 2010-12-12 12:42

>>17
That's because IEEE754 is batshit insane.

Don't change these.
Name: Email:
Entire Thread Thread List