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, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
question
Computers and Technology, 23.06.2019 20:30
If an appliance consumes 500 w of power and is left on for 5 hours, how much energy is used over this time period? a. 2.5 kwh b. 25 kwh c. 250 kwh d. 2500 kwh
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
To move a file or folder in microsoft windows, you can click and hold down the left mouse button while moving your mouse pointer to the location you want the file or folder to be, which is also known as.
Answers: 3
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
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
Mathematics, 17.12.2021 01:30
question
Mathematics, 17.12.2021 01:30