1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nikitadnepr [17]
3 years ago
13

Codio Challenge Activity PythonWe are passing in a list of numbers. You need to create 2 new lists in your chart, then put all o

dd numbers in one list put all even numbers in the other list output the odd list first, the even list secondTip: you should use the modulo operator to decide whether the number is odd or even. We provided a function for you to call that does this.Don’t forget to define the 2 new lists before you start adding elements to them.------------------------------------------------------------Requirements:Program Failed for Input: 1,2,3,4,5,6,7,8,9Expected Output: [1, 3, 5, 7, 9][2, 4, 6, 8]------------------------------------------------------------Given Code:# Get our input from the command lineimport sysnumbers = sys.argv[1].split(',')for i in range(0,len(numbers)):numbers[i]= int(numbers[i])def isEven(n) :return ((n % 2) == 0)# Your code goes here
Computers and Technology
1 answer:
lilavasa [31]3 years ago
7 0

Answer:

The python code is given below with lists defined.

Explanation:

import sys

def isEven(n) :

 return ((n % 2) == 0)  //for even items

numbers = sys.argv[1].split(',')

for i in range(0,len(numbers)):

 numbers[i]= int(numbers[i])

even = []

odd = []

for i in numbers:

   if isEven(i):

       even.append(i)  #adds i to even list if it is even

   else:

       odd.append(i)  #adds i to odd list if not even (odd)

print(odd)

print(even)

You might be interested in
A ___describes a particular attribute of the dates item in a table​
Vikentia [17]

Answer:

\huge\star{\underline{\mathtt{\red{A}\red{n}\red{s}\red{w}\red{e}\red{r}}}}\huge\star

.

<h3><em>A</em><em><u> objective</u></em><em><u> </u></em><em><u>of</u></em><em><u> technique</u></em><em> </em><em>describes a particular attribute of the dates item in a table</em><em>.</em></h3>

<em>.</em>

<em>I </em><em>hope</em><em> </em><em>this</em><em> </em><em>helps</em><em> </em><em>you</em><em>.</em><em>.</em><em>.</em><em>.</em><em>.</em><em>.</em><em>.</em>

5 0
3 years ago
The ________ multiple-selection PHP statement is used to handle decision making and can be used to replace multiple if and if...
Sedaia [141]

Answer:

Option (4) is the correct answer of this question.

Explanation:

The switch is used to handle the multiple selections in the program when we need to choose on the condition and we have more then one condition arises then we have used the switch statement in the PHP.

Syntax of using Switch:-

switch(variable)  

{

case 1. statement

Break;

..................

default :

case n:

statement n

}

Other options do not use multiple selections so they are incorrect options.

7 0
3 years ago
Stating a document is PDF or XPS document refers to document _______​
Sedbober [7]

Answer:

asxdfrthyjukilo;

Explanation:

3 0
3 years ago
I am buying a BluRay drive access time is 180ms and the other is 210ms(BD-ROM) whats does access time mean
kkurt [141]
It means how fast it can read the disk so if you want faster data transfer you would go for blurry if you really don't care go for the other one
6 0
3 years ago
A quick boot allows you to do what?
WITCHER [35]
Access the BIOS setup
6 0
3 years ago
Read 2 more answers
Other questions:
  • Hi <br> What exactly does this project want from me?thanks for riding
    5·1 answer
  • A snail goes up A feet during the day and falls B feet at night. How long does it take him to go up H feet? Given three integer
    8·1 answer
  • Energy is defined as stored energy
    13·2 answers
  • How many 16ths are in 3/8 of an inch
    12·1 answer
  • The memory unit of a computer has 256k words of 32 bits each. The computer has an instruction format with 4 fields: an opcode fi
    15·1 answer
  • What is wrong with the following C++ code? How would you fix it? int sum; for (int i=0; i&lt;1000; ++i) sum += i; { printf("Sum
    5·1 answer
  • How does computer number system play a Vital role in a computer calculation. ​
    8·1 answer
  • (a) Write a program which calculates and displays the obtained marks, percentage in six subjects and assigns grades based on per
    6·1 answer
  • What component of a game makes victories feel earned and helps the player become physchologically engaged by the play experience
    11·1 answer
  • How will technology help people with disabilities become more transportation independent?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!