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
Software that manages the resources of the computer is called:
AleksAgata [21]
A. Data management software.
6 0
3 years ago
Suppose a computer has 16-bit instructions. The instruction set consists of 32 different operations. All instructions have an op
Kazeer [188]

Answer:

2^7= 128

Explanation:

An instruction format characterizes the diverse part of a guidance. The fundamental segments of an instruction are opcode and operands. Here are the various terms identified with guidance design:  Instruction set size tells the absolute number of guidelines characterized in the processor.  Opcode size is the quantity of bits involved by the opcode which is determined by taking log of guidance set size.  Operand size is the quantity of bits involved by the operand.  Guidance size is determined as total of bits involved by opcode and operands.

6 0
4 years ago
IF ANSWER I WILL BE REALLY HAPPY
butalik [34]

Answer:

C.

Explanation:

7 0
3 years ago
Read 2 more answers
Identity management programs often implement a _________system that facilitates the management of user accounts.
Trava [24]

Answer:

single sign-on

Explanation:

Identity management programs in computer operation involve an administrative process that is carried out by implementing a SINGLE SIGN-ON system that facilitates the management of user accounts.

The purpose is to identify, validate, and approve an individual or group of people to have permission to various applications, computer systems, or networks by linking user rights and limitations with created identities.

Hence, in this case, the correct answer is SINGLE SIGN-ON

6 0
3 years ago
Prior to the world wide web as we know it today, the internet was chaotic, without any ____.
atroni [7]
Search engines - there was no single way to ask a question
5 0
3 years ago
Other questions:
  • (tco 3) what vbscript boolean operator could be used to replace the nested selection structure in this pseudocode? if empmedical
    13·1 answer
  • A technician is troubleshooting an employee laptop that has a wired network connectivity issue. The laptop can connect to the in
    9·2 answers
  • Inthe old days, databases did NOT support ____________.
    10·1 answer
  • The mutating-table error is raised when a trigger attempts to execute a. an INSERT, UPDATE, or DELETE while another user is upda
    10·1 answer
  • How do design elements and color work together on a web page?
    15·1 answer
  • Write the output of the following program:
    8·1 answer
  • How is video compression accomplished?
    14·1 answer
  • HOMEWORK: Bud, Not Buddy I NOTICE... What do you see? chpter 3-4<br><br>​
    14·1 answer
  • Match each type of video camera to its features:
    15·1 answer
  • What methods could you use to set up printing in an organization?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!