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
Marina CMI [18]
1 year ago
5

9.18 lab: even/odd values in a vector write a program that reads a list of integers, and outputs whether the list contains all e

ven 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. isvectoreven returns true if all integers in the array are even and false otherwise. isvectorodd returns true if all integers in the array are odd and false otherwise. bool isvectoreven(vector myvec) bool isvectorodd(vector myvec)
Computers and Technology
1 answer:
lana66690 [7]1 year ago
6 0

def is_list_even(my_list):

   for i in my_list:

       if(i%2 != 0):

           return False

   

   return True

   

   

def is_list_odd(my_list):

   for i in my_list:

       if(i%2 == 0):

           return False

   

   return True

   

def main():

   n = int(input())

   lst = []

   

   for i in range(n):

       lst.append(int(input()))

   

   if(is_list_even(lst)):

       print('all even')

   

   elif(is_list_odd(lst)):

       print('all odd')

   

   else:

       print('not even or odd')

       

       

if __name__ == '__main__':

   main()

You might be interested in
On the seventh day of the iteration, the team realizes that they will not complete 5 of the 13 stories. the product owner says s
nika2105 [10]

Answer:

First of all the team should excuse to the product owner for not being responsible and committed to the deadline.

Secondly, as they have completed the 8 stories, so they should revise and check the flaws in those stories and send to her.

Because when the product owner will check and happy with them, she will surely discuss the remaining stories with the team.

6 0
3 years ago
TLE 10 - ICT
Kipish [7]

Answer:

Information And Communication Technology

5 0
2 years ago
The physical components of a computer, such as a keyboard or hard drive, is called?
faust18 [17]

I'm assuming hardware.


Remember, Hard = Physical.


If that's not it, try peripherals.

4 0
3 years ago
7.2 code practice edhesive
goblinko [34]

Answer:

Explanation:

got a 100

7 0
3 years ago
Read 2 more answers
To freeze rows 1 and 2, and columns 1, 2, and 3, which cell should you highlight before selecting freeze panes?.
Brilliant_brown [7]

In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.

<h3>How do one freeze several column?</h3>

This can be done when a person select the column that's is said to be next to the right of the last column a person want to freeze.

Therefore, In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.

Learn more about panes from

brainly.com/question/17194167

#SPJ1

4 0
1 year ago
Other questions:
  • You are attempting to update a Windows image that has been mounted under C:\mount on your local system. What command must you us
    13·1 answer
  • What is the part of the browser window that displays the content of the web page such as pictures and text called?
    10·1 answer
  • Review the two e-mail messages below for their adherence to the guidelines for professional e-mail correspondence you have learn
    6·1 answer
  • why are the ads you might see on tv between 8am and 10am usually not the same ads you would see between 8pm and 10pm?
    12·1 answer
  • Robert's employer has agreed to pay half the tuition for Robert to complete his college degree. This benefit is known as what?
    7·2 answers
  • When looking at a relationship between two tables on an ERD, the _____ table can be identified by the presence of a foreign key
    8·1 answer
  • Out of a list of the values 8, 3, 30, 5, 15, and 6, what result would the MIN function return?
    9·2 answers
  • Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the info
    10·1 answer
  • List three features of the third generation of computers
    13·1 answer
  • 9. Which of the following is considered an interface? (1 point)
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!