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:
Anonymous2010-04-02 15:01
d0, d1, d2, d3 = map(lambda n: fresult[1][n] - fresult[2 if n != 3 else 3][n], range(4))
python sucks tho
Name:
Anonymous2010-04-02 15:02
You shouldn't because Guido does not like functional constructs like map so you should use a loop instead.
>>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.
This thread was started because someone doesn't really understand it. Mind blown that thread still going past post 2.
Enterprise Software
/YOURANUS/ designs, implements, operates, and improves Enterprise Software Solutions. The ESS practice focuses on e-mail, directory services, collaboration, migration, and enterprise Windows application platforms.
* Microsoft Infrastructure Implementations
* Volume Licensing Agreements
* License Tracking and Management
* E-Procurement Reporting
* Exchange Server Solutions
* Active Directory Integration and Migration
* Windows Server Solutions
* Desktop Implementation and Migration
* Windows Operating Systems
* Microsoft Collaboration Solutions
Since it's a language that prides itself on "readability", Python should provide better sugar for traversing things in parallel. It's not that uncommon.
Name:
Anonymous2010-04-02 19:05
d0, d1, d2, d3 = [a - b for (a, b) in zip(fresult[1], fresult[2])], assuming that last line is a typo.