🔥🔥🔥🔥🔥 Beat 99% 🔥🔥🔥🔥🔥 EASY 🔥🔥🔥🔥🔥🔥
\n\n\n# Code\n\nclass Solution(object):\n    def sortArrayByParity(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[int]\n        
[![Screenshot 2024-03-22 175737.png](https://assets.leetcode.com/users/images/5c9d6954-e8c4-42ab-bba2-626dc9456d5c_1711172038.879572.png)\n](https://leetcode.com/problems/sort-array-by-parity/submissions/1211394593/)\n\n# Code\n```\nclass Solution(object):\n    def sortArrayByParity(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[int]\n        """\n        l1 = []\n        l2 = []\n        for num in nums:\n            if num%2==0:\n                l1.append(num)\n            else:\n                l2.append(num)\n        return l1 + l2\n```
['Python', 'Python3']