Hacker News new | past | comments | ask | show | jobs | submit login

Uh,

  def swap(a, b):
      return b, a
?

Or since this is presumably python, just inline it without a function:

  (a, b) = (b, a)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: