Skip to content

Instantly share code, notes, and snippets.

@yangsheng1107
Created June 7, 2014 01:47
Show Gist options
  • Select an option

  • Save yangsheng1107/9b28e1c0d3540fc7ade2 to your computer and use it in GitHub Desktop.

Select an option

Save yangsheng1107/9b28e1c0d3540fc7ade2 to your computer and use it in GitHub Desktop.
def swap(a, b):
return b, a
# = = = = = = = = = = = = = = = = = = = = = = = = = = =
# mian function
# = = = = = = = = = = = = = = = = = = = = = = = = = = =
if __name__ == '__main__':
a = 10
b = 15
print "before swap a = " + str(a) + " ,b = " + str(b)
a, b = swap(a, b)
print "after swap a = " + str(a) + " ,b = " + str(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment