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

One word, forced indentation of code

Name: Anonymous 2007-06-25 12:21 ID:BtQsWoqp

Can someone explain why /prog/ thinks this is a bad thing? Who the fuck *doesn't* indent their code? And why do we need brackets if the code blocks are already defined by indentation? Makes perfect sense to me.

Name: Anonymous 2007-06-26 12:49 ID:8XMUKpjf

>>25
You can return more than one item in Python. For example:

def f(x):
    return x, x + 1

def g(x, y):
    print "I've got %d and %d" % (x, y)

#Call function saving its values
x, y = f(3)
#Call function capturing its values in a single tuple
x = f(3)
#Call function passing its two results to another function
g(*f(3))

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