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 10:00
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
question
Computers and Technology, 24.06.2019 12:40
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Think of a spreadsheet as a giant calculator spread of paper chart data collector
Answers: 2
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
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
Mathematics, 14.01.2021 23:40
question
Mathematics, 14.01.2021 23:40
question
Health, 14.01.2021 23:40
question
Mathematics, 14.01.2021 23:40
Questions on the website: 13722366