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

python, how?!

Name: Anonymous 2008-11-30 10:45

hi.
i want to learn programming, but in my area there ain't anybody that can help me, so i want to ask for something only, kind of beginners book, or anything, and in a language that is powerfull. i heard of python, but i dont know anything about this. help?

Name: Anonymous 2008-12-01 3:10

>>22
>>24
Example
The typical C/C++/C#/Java for loop idiom where you're going over an array and doing shit with it

int i;
for (i = 0;i < SomeUpperLimit;++i) {
  // gay nigger cocks
  transmogrify(AllThemDoodads[i]);
}

in Python you're going to be iterating over lists a lot, as a Python newfag you're going to naively write something like this
for i in range(SomeUpperLimit):
   # Chink jew vaginas
   dostuff('with', 'things', AllThemDoodads[i])

range(SomeUpperLimit) produces a huge list of however many integers you need and you'll end up wasting a shit-ton instead memory as a novice python programmer and people on IRC will make fun of if you do this because they're dicks
xrange(SomeUpperLimit) would be better because it's a generator that just returns another successive integer every time, but that's not 'Pythonic' enough, as python fags would call it. We can do even better.
for doodad in AllThemDoodads:
   # Ass dick kike
   dostuffwith(doodad) # lol look at this fag shit

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