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 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
question
Computers and Technology, 24.06.2019 03:30
What is the purpose of a computer network needs assessment? to analyze which workers need more training to improve their performance to compare worker productivity to determine what steps employees can take to increase company revenue to evaluate how to move from the current status to the desired goal
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, 11.11.2020 17:50