进阶版代码:
nums = list(map(int,input().split(',')))
l, r = 0, len(nums) - 1
while l < r:
while l < r and not nums[l] % 2:
l += 1
while r > l and nums[r] % 2:
r -= 1
#进阶版的意思就是只在本数组上面操作,不需要借助额外的数组
nums[l], nums[r] = nums[r], nums[l]
print(nums)