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
Explain two ways by which the calendar meets or fails to meet the criteria of showing the correct data
gtnhenbr [62]

Answer:

The two ways the calendar meets the criteria of showing the correct date are;

1) The calendar can give dates in the 12 months in a year

2) The calendar can show up to the 31 different days in a month

Explanation:

The two ways in which the calendar meets the criteria of showing the correct date are;

1) The number number of long blocks with 4 different months each = Three

Therefore, the total number of months the blocks can hold = 3 × 4 months = 12 months = The number of months in a year

2) The number of faces on each dice = 6 faces

The number of dice = 2 dice

The total number of faces = 12

The number of identical faces = 2 (11th and 22nd of the month)

The number of unique faces = 10

The number of combinations of the dices = ₁₀C₂ = 45

The number of combination of faces required to show = 1 to 31 = 31 combination

Therefore, there are adequate combinations on the dice to show all the dates of month

7 0
3 years ago
Why did the i have a dream speech happen
lions [1.4K]
Because he wanted equal rights for everyone
7 0
3 years ago
Consider the following code: def tryIt(b): for i in range(len(b)): b[i] = b[i] + 100 #***********MAIN************ x = [] x = [56
WINSTONCH [101]

Answer: I took a high school robotics class when I was in 5th grade and I don't even understand your code there aren't any instructions other than <em>"</em><em><u>Consider</u></em><u>"</u> the following code you may want to improve your question

7 0
2 years ago
How are programs and algorithms related? A program is a part of an algorithm. They are not connected at all. An algorithm is a p
almond37 [142]

Answer:

A program is a set of instructions that a computer executes.

An algorithm is a set of instructions that must be done in order to get some result.

If an algorithm is written in a programming language, then the program is an implementation of the algorithm.

An algorithm must not, however, be a program. An algorithm can also be performed manually (e.g. calculate 6431 + 8316 on paper or in your head).

Explanation:

6 0
3 years ago
Mary, Tim, John, and Jenn each sold three million dollars worth of product within six months. Each month one of them was awarded
photoshop1234 [79]

if its the same chart im looking at on this page, the answer is john.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Numeric data is stored in ___________ for direct processing.
    10·2 answers
  • What can a person do to help increase their credit score? AUse only a small percentage of your credit limit. BResearch student l
    8·1 answer
  • How do you get 99 points on sunny meadows simulation?
    6·2 answers
  • How does this splitting wedge make work easier?
    15·1 answer
  • Write a function named change() that has an integer parameter and six integers reference parameters named hundreds, fifties, twe
    7·1 answer
  • What option do you use to view your presentation?
    15·1 answer
  • The design of a blog refers to:
    8·1 answer
  • What is the difference between KE an PE
    8·1 answer
  • What is the most common knowledge computer programmers need in order
    15·2 answers
  • Say true or false
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!