subject

Given an array a of non-negative integers, return an array consisting of all the even elements of a, followed by all the odd elements of a.
example 1: input: [3,1,2,4] output: [2,4,3,1]
this is the code there is to start:
def sortarraybyparity(a):
a = [3,1,2,4]
print(sortarraybyparity(a))
how do i iterate over the numbers to test if they are even or odd?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:00
Which of the following “invisible” marks represents an inserted tab?
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
question
Computers and Technology, 24.06.2019 06:50
What are the things you are considering before uploading photos on social media?
Answers: 1
You know the right answer?
Given an array a of non-negative integers, return an array consisting of all the even elements of a,...
Questions
question
Chemistry, 17.11.2020 04:20
question
Mathematics, 17.11.2020 04:20
question
Chemistry, 17.11.2020 04:20
question
Mathematics, 17.11.2020 04:20
question
Engineering, 17.11.2020 04:20