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]
4 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]4 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
Being aware of and understanding why potential buyers on a web site do not complete their purchases requires the expertise of __
TiliK225 [7]
<span>a web analyst and usability expert</span>
8 0
3 years ago
Read 2 more answers
Corey wrote a code that will display his name every time he presses the down arrow key but there is a bug in it. Display letter
brilliants [131]

Answer:

Explanation:

display letter c, type letter r, type letter o, type letter 3, type letter y- i think thats it but i dee cay this is confusing

7 0
3 years ago
How do you turn on the Track Changes feature in a spreadsheet?
myrzilka [38]
I would "turn on" this track changer as I would usually go to the top left corner, where it would say edit, and then, usually, as you look down at the bottom, you would then see where it would then be a switch that would say "turn on" or "turn off" track changer.
4 0
4 years ago
Consider the following definitions:public boolean someMethod (int[] list, int value){ int counter; boolean flag = false; for (co
alexandr1967 [171]

Answer:

C. Under the condition that value != list[list.length − 1]

Explanation:

In the loop, the value of flag gets overwritten in each iteration, so only the last value of the list matters. Flag is true when value is not equal to the last list element, which is at position list.length-1.

4 0
4 years ago
I WILL MARK BRAINLIEST IF CORRECT!!!!!!!!!!!!!!!!!!!!!!!!!!!!
e-lub [12.9K]

the second answer is correct

7 0
3 years ago
Read 2 more answers
Other questions:
  • Before text can be formatted you must first
    10·2 answers
  • fill down feature on a formula and you need to keep a cell reference the same which one will allow you to keep the same cell ref
    15·1 answer
  • Siva added a "Contact Form" to her website.
    10·1 answer
  • The most common layout of keys on the keyboard is the _____ keyboard.
    5·2 answers
  • Write a c++ application that computes gross salary for Mr.A,given that during the interview session and before started work, it
    5·1 answer
  • Which of these is not the correct method for moving text in a document in Word 2016?
    7·1 answer
  • an IPv6 packet has a 40 byte base header, a 20 byte destination options extension header (which is not used for routing) and 200
    5·1 answer
  • Michael’s team is presenting a robot before their examiners. What do they need which is a definitive description of the final pr
    6·1 answer
  • 22. (a) List two arithmetic
    7·1 answer
  • Heuristics are not always completely accurate.<br><br><br> Correct or wrong?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!