Created
December 13, 2011 14:23
-
-
Save dketov/1472283 to your computer and use it in GitHub Desktop.
Возвращаемые значения
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
""" | |
Возвращение единственного параметра | |
""" | |
def inc(x): | |
return x + 1 | |
foo = 10 | |
foo = inc(foo) | |
print foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
""" | |
Возвращение кортежа | |
""" | |
def next_block(): | |
p1 = 2 | |
p2 = 2.3 | |
p3 = "c" | |
p4 = "String" | |
p5 = "3.4444" | |
return p1, p2, p3, p4, p5 | |
p1, p2, p3, p4, p5 = next_block() | |
print p1 | |
print p2 | |
print p3 | |
print p4 | |
print p5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment