subject
Computers and Technology, 07.12.2019 04:31 jessv01

Codio challenge activity python

we are passing in a list of numbers. you need to create 2 new lists in your chart, then

put all odd numbers in one list

put all even numbers in the other list

output the odd list first, the even list second

tip: 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,9

expected output: [1, 3, 5, 7, 9]
[2, 4, 6, 8]


given code:

# get our input from the command line
import sys
numbers = 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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
Write a function that draws a pool ball. this function should take as parameters, the color, the number that should go on the pool ball, and the location of the center of the pool ball. the radius of the pool balls should be pool_ball_radius, and the font of the number should be pool_ball_font. the text of the pool ball font should be white. drawpoolball(color.orange, 5, 100, 100); drawpoolball(color.green, 6, 50, 200); drawpoolball(color.red, 3, 150, 350); drawpoolball(color.blue, 2, 250, 140); to center the numbers on the pool ball, you should use the getwidth() and getheight() methods. you are allowed to call these methods on your text object, such as txt.
Answers: 3
question
Computers and Technology, 22.06.2019 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 24.06.2019 15:50
Andy would like to create a bulleted list. how should he do this? andy should click on the bullet icon or select the bullet option from the menu and then type the list. andy should press the shift key and the 8 key at the beginning of each line of text. andy should type the text and then click on the bullet command. andy should press return and the bullets will automatically
Answers: 2
You know the right answer?
Codio challenge activity python

we are passing in a list of numbers. you need to create...
Questions
question
Biology, 10.09.2020 03:01
question
Physics, 10.09.2020 03:01
question
Physics, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
History, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
Geography, 10.09.2020 03:01
question
History, 10.09.2020 03:01
question
Chemistry, 10.09.2020 03:01
question
Biology, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
Biology, 10.09.2020 03:01
question
Geography, 10.09.2020 03:01
question
World Languages, 10.09.2020 03:01
question
Mathematics, 10.09.2020 03:01
question
Biology, 10.09.2020 03:01
Questions on the website: 13722361