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

snippet, python

Name: retard 2010-04-02 14:45

i always get hung up on stupid shit. like, i didn't study my python docs or sicp today, i know. but how do i make this into one line? thx /prog/

        d0=fresult[1][0]-fresult[2][0]
        d1=fresult[1][1]-fresult[2][1]
        d2=fresult[1][2]-fresult[2][2]
        d3=fresult[1][3]-fresult[3][3]

Name: Anonymous 2010-04-02 18:29

>>3
A list comprehension, actually.

>>8
Python is the best all-round language there is. There are some areas where it's weaker than some alternatives, but those alternatives tend to be much worse in other areas.

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