class Solution(object):

    def sortArrayByParity(self, A):
        """
        :type A: List[int]
        :rtype: List[int]
        """
        evens = []
        odds = []
        for element in A:
            if element % 2 == 0:
                evens.append(element)
            else:
                odds.append(element)
        return evens + odds

e3c895ac0e10ae228c8e49c476d7c5ea6600510a
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def sortArrayByParity(self, A):
        """
        :type A: List[int]
        :rtype: List[int]
        """
        evens = []
        odds = []
        for element in A:
            if element % 2 == 0:
                evens.append(element)
            else:
                odds.append(element)
        return evens + odds
