Solution 1: traverse and swap last 0 and last non 0

```
class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
last0 = 0
for i in range(0,len(nums)):
if (nums[i]!=0):
nums[i],nums[last0] = nums[last0],nums[i]
last0+=1
```

Solution 2 : one-liner from @toontong: use sort() with customized compare function

```
class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
nums.sort(cmp=lambda a,b: 0 if b else -1)
```