Live data from Hacker News

Learn Python in minutes

learnxinyminutes.com

51–59 of 59 posts

Re: Learn Python in minutes

#51
post #46

I don't know the efficacy of this as an educational tool, but as a Python programmer, it's a really handy "cheat sheet" to have around whenever doing general scripting. It's really well written as well. Kudos to whomever wrote it.

Author here.

Glad you find it useful!

Re: Learn Python in minutes

#52

This looks very similar to the notes I was taking on my own when going through "learning python the hardway". Yours are much better and easier to read though, and make more sense in terms of going from very easy to more complicated in staggered steps. Great stuff! As a sidenote, how does everyone take note (if you even do) when learning something new like a language or some kind of skill?

I make guesses about what the result of something will be, check the guesses to see if they work and then write down why I think they worked or didn't work.

Re: Learn Python in minutes

#53

Wow. I've only every programmed Java and this looks amazing. I'm so sorry scripting languages, I've neglected you!

I've been forced to use C# for the last week. I'm so sorry scripting languages, I'll be back soon! I miss you!

Re: Learn Python in minutes

#54

Earlier quoted context omitted.

I used to sleep with a walkman plugged in and playing german vocab - everyone knew that was guaranteed to work

I put my computer on youtube's google io talk whenever I can't get to sleep. It sures put me to sleep fast. :-) If Michael Jackson just knew that......

...he would still be alive , lol !

Re: Learn Python in minutes

#56
I'm usually a php guy, and recently I had to use some vendor's python api to do some data integration and this might have come in handy. I picked up python, or atleast the basic syntax in roughly 1 day, and was done with my implementation within the next day.

Re: Learn Python in minutes

#57
post #33
post #18

int, boolean, float etc. are not _primitive_ data types in python. If you say that, you really have no idea, what you are talking about. They are objects like everything else. You can inherit from them and do all the good OO stuff. Sorry for the nitpicking, but calling them primitive types, is just plain wrong.

Author here. Sorry for that. I know they are objects but if you consider everything an object then really you have no primitives except object itself. Certainly this has a place in programming philosophy but not really a helpful point in a language-primer/cheat sheet.

Why not call them "built-in" then?

Re: Learn Python in minutes

#58
post #9

What does he mean by "# Tuples are created by default if you leave out the parentheses". With or without the parens I'm getting the same result for "a, b, c = (1, 2, 3)"

You get a list if you do "object_a = [1, 2, 3]" and a tuple if you do "object_b = (1, 2, 3)". Then try "object_c = 1, 2, 3" and you'll also get the tuple.

You should also mention the 1-item case where the (optional in other cases) trailing comma is required to form a tuple: (1,)

Re: Learn Python in minutes

#59
This might be even more useful as an ipython notebook so that people can modify and execute any of the examples. The easiest way to host a notebook that users can try from their browser seems to be Wakari (public viewing, free signup needed to modify/run).
Post reply on HN