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
Readme [11.4K]
3 years ago
10

Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither.

The input begins with an integer indicating the number of integers that follow. Ex: If the input is: 5 2 4 6 8 10 the output is: all even Ex: If the input is: 5 1 3 5 7 9 the output is: all odd Ex: If the input is: 5 1 2 3 4 5 the output is: not even or odd Your program must define and call the following two functions. is_list_even() returns true if all integers in the list are even and false otherwise. is_list_odd() returns true if all integers in the list are odd and false otherwise. def is_list_even(my_list) def is_list_odd(my_list)
Computers and Technology
1 answer:
Ivahew [28]3 years ago
7 0

Answer:

def is_list_even(list):  

 return all((x % 2) == 0 for x in list)  

def is_list_odd(list):

 return all((x % 2) == 1 for x in list)  

numberList = []  

n = int(input("Enter number of elements : "))  

for i in range(0, n):  

 numberList.append(int(input()))

if is_list_even(numberList):

 print("all even")

elif is_list_odd(numberList):

 print("all odd")

else:

 print("not even or odd")

You might be interested in
You have defined a scope on your DHCP server with the start address 172.16.1.1, end address 172.16.1.200, and prefix length 16.
Andre45 [30]

Answer:

B

Explanation:

prefix 16 got 255.555.0.0 subnet mask & 65,536 total host. so in your case it ill take 172.16.0.0 - 172.16.255.255 / subnet and your scope ill take the 172.16.1.1 - 172.16.1.200 . for the next subnet is 172.17.0.0 - 172.17.255.255 and same thing as your scope you ill take 172.17.1.1 - 173.17.1.200 . keep learning bro :)

7 0
3 years ago
What is a two content slide​
daser333 [38]

Answer:

Slide layouts define containers, positioning, and formatting for all of the content that appears on a slide. Placeholders are the containers in layouts that hold such content as text (including body text, bulleted lists, and titles), tables, charts, SmartArt graphics, movies, sounds, pictures, and clip art.

Explanation:

5 0
3 years ago
Hola, disculpa me podrías ayudar enviándome una captura dándole like a este video? Por favor, es un proyecto escolar en el que e
PtichkaEL [24]

Answer:

Una captura de pantalla es una instantánea de la pantalla de un dispositivo informático, como un teléfono o una computadora. Mantenga presionado el botón de encendido y el botón de columna hacia abajo para tomar una captura de pantalla en teléfonos inteligentes.

Explanation:

Una captura de pantalla de la pantalla de un dispositivo de computadora es como tomar la foto de una pantalla. Para los teléfonos inteligentes, presionar la columna hacia abajo y el botón de encendido tomaría la instantánea del teléfono.

Para darle Me gusta a un video en una plataforma de redes sociales, simplemente haga clic en el ícono de pulgar hacia arriba.

6 0
3 years ago
_____________ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a
Maksim231197 [3]

Answer: E) Input validation

              C) Data validation

Explanation:

  • Input validation is the process of analyzing and testing input's quality and correctness that are being processed at further level in information system.It help in eliminating any type of improper or informal input data from getting supplied to user or program in a system.
  • Input validation is also known as data validation.As the input that is being tested and validated is form of data that is going through cleansing task to remove useless data.
  • According to the question, data and input are being inspected to extract the validity and correctness of it before sending it for computation .Thus , both data and input validation is happening in this case.
  • Other options are incorrect because testing is examining the data.Correction data and input is the step for rectifying the mistakes in data or input.
  • Thus, the correct option is option(C) and (E).

4 0
4 years ago
░▒▓█►─═ ℍᵒ ═─◄█▓▒░ (っ◔◡◔)っ ♥ how are you doing ♥
Lera25 [3.4K]
I’m not doing too hot
Stressing over school and I doesn’t help that I don’t understand somethings
8 0
3 years ago
Other questions:
  • Universal Windows Platform is designed for which Windows 10 version?
    7·1 answer
  • What following functions does browser perform
    5·1 answer
  • Write a sentinel-controlled while loop that accumulates a set of integer test scores input by the user until negative 99 is ente
    8·1 answer
  • Why is brainly not working it say im logged out rn but im not i cant acces anything but this
    12·2 answers
  • Nonverbal messages from the movie it​
    5·2 answers
  • True or False, A column is a horizontal arrangement for items of information.
    15·1 answer
  • // This program assigns values to two variables // and performs mathematical operations with them public class DebugFour1 { publ
    7·1 answer
  • Question # 2 Multiple Select You wrote a program to compare the portion of drivers who were on the phone. Which statements are t
    6·1 answer
  • What are real online jobs any one of any age can get pays weekly by Pay<br> Pal
    8·1 answer
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!