Skip to content

Instantly share code, notes, and snippets.

@dketov
Created December 13, 2011 14:23
Show Gist options
  • Save dketov/1472283 to your computer and use it in GitHub Desktop.
Save dketov/1472283 to your computer and use it in GitHub Desktop.
Возвращаемые значения
# -*- encoding: utf-8 -*-
"""
Возвращение единственного параметра
"""
def inc(x):
return x + 1
foo = 10
foo = inc(foo)
print foo
# -*- 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