Python

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. if the input is: 5 2 4 6 8 10 then the output is: all even if the input is: 5 1 3 5 7 9 then the output is all odd if the input is: 5 1 2 3 4 5 then the output is: not even or odd your program must define and call the following three functions. def getuservalues(). getuservalues reads in, creates, and returns the list of integers. def islisteven(mylist). islisteven returns true if all integers in the list are even and false otherwise. def islistodd(mylist). islistodd returns true if all integers in the list are odd and false otherwise.

Answers

Answer 1

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()


Related Questions

Jake is a 6-year-old boy. his mother wants him to learn scissor skills for improving his finger grip. so, she hands him several colorful papers and a pair of scissors. jake does not have difficulty understanding which object cuts the other. what is this type of reasoning called?

a.
analogical
b.
deductive
c.
common sense
d.
inductive

please answer so brainly doesnt get rid of it.

Answers

According to this, I think it is common sense.

One hint that you might be dealing with a phishing site is: a) Hidden address bar b) Fake address bar c) Misspelled text d) All the above

Answers

One hint that you might be dealing with a phishing website is: D. all the above.

What is phishing?

Phishing can be defined as a type of social engineering (cyberattack) which involves making an attempt to obtain sensitive user information, especially by disguising as a trustworthy entity in an electronic communication, which is usually over the Internet.

This ultimately implies that, some of the hints that an end user might be dealing with a phishing website include the following:

Hidden address bar.Fake address bar.Misspelled text

Read more on phishing here: https://brainly.com/question/23850673

#SPJ1

software that requires a monthly subscription fee is called

Answers

Answer:

Software as a service

Explanation:

You may hear this as (SaaS) for short.

a computer is made up of four different types of devices which are

Answers

A computer is made up of four different types of devices which are input, storage, processing and output devices.

What are computer devices?

Computer devices are those components of computer known as the computer hardware that ensures the proper functioning of the system.

The four different types of devices found in the computer are :

Input devices: These are used to put in data into the system.

Storage device:. These are used for storage of processed data.

Processing device: This is the brain box of the computer.

Output devices: They are used to display data.

Learn more about hardware here:

https://brainly.com/question/24370161

#SPJ1

The logo for Ask search engine​
and pls no links

Answers

Answer:

Explanation:

hope it helps

Type the correct answer in the box spell all words correctly.
karl has designed an interactive stories website for kids. he has implemented an alphabetical format for browsing through the stories. which
structure will he use for easy navigation?
kart implements a
structure for users to advance through the chapters.
reset
nexus

Answers

Kart should implement a main navigation structure for users to advance through the chapters.

The types of navigation.

In Computer technology, there are three main types of navigation used on websites and these include the following:

Structural navigationUtility navigationAssociative navigation

In this scenario, Kart should implement a main navigation structure for users to advance through the chapters on this interactive stories website for kids.

Read more on website here: https://brainly.com/question/26324021

#SPJ1

What is the need for computer programming?

Answers

Answer:

See Explanation

Explanation:

Programming languages use classes and functions that control commands. The reason that programming is so important is that it directs a computer to complete these commands over and over again, so people do not have to do the task repeatedly. Instead, the software can do it automatically and accurately.

who am I ?

please say me the answers

Answers

Answer:

motherboard

Explanation:

because it serves as a platform to connect all the other parts of the computer. it is where CPU, harddrive, optical drives and other expansion are directly connected.

What is it called when you use a specific piece of data, rather than a variable, for a value that should be able to change?

a.
debugging

b.
hard coding

c.
top-down programming

d.
data encoding

Answers

Answer:

data encoding

Discuss the variety of shapes and sizes in which cases come for desktops, laptops, tablets, smartphones, portable media devices, and game consoles.

Answers

Modern computers are comes in a multitude of designs, sizes, and designs. There is a computer form to suit each use, whether it's a massive tower under a desk or a small brick the size of, well, a brick.

How is a laptop different from a desktop?

A desktop uses an external monitor, keyboard, and mouse to be used at work or at home, whereas a laptop has all of these components integrated in and can be easily transferred as a single device that can be used in a number of locations.

Thus, Modern computers are comes in a multitude of designs, sizes, and designs.

For more information about laptop different from a desktop, click here:

https://brainly.com/question/19340665

#SPJ1

Identifying correction services tasks
what are some tasks commonly performed in correction services jobs? check all that apply.
interviewing law offenders
using weapons, handcuffs, and other tools to control prisoners
transporting people who are sick or injured to hospitals
maintaining order and security in a courtroom
searching prisoners and their belongings
o providing legal advice to inmates
o guarding and counting inmates

Answers

The correction services tasks are:

The using of weapons, handcuffs, and other tools to control prisonersTransporting people who are sick or injured to hospitalsGuarding and counting inmates.

What is the role of the corrections?

Corrections is known to be  the aspect of  criminal justice system that helps to handle individuals who have been found to have done or committed  a crime.

Note therefore, that the correction services tasks are:

The using of weapons, handcuffs, and other tools to control prisonersTransporting people who are sick or injured to hospitalsGuarding and counting inmates.

Learn more about correction services from

https://brainly.com/question/6705028

#SPJ1

Answer:

a.b.e.g

Explanation:

HELP ASAP
Select the correct answer.
When designing an algorithm, what structure can be used to repeat some steps if a condition is met?
OA. iterations
OB. loops
OC. conditional
OD. flowcharts
OE. pseudocode

Answers

Answer:

B. loops

Explanation:

The while loop is used to iterate over a portion of code until a certain condition is fulfilled. Let's imagine we want to know how many times a number may be divided by two before it becomes less than or equal to one.

Zenith Computers is a software development company. It has received a random email claiming that there will be an attempt to hack and extract sensitive financial data of the company before the year end. The company has contacted you, a network analyst, to verify if such claims are indeed true. You have decided to set up a trap for the hackers by putting up a system containing false financial data. Which of the following will you use in this scenario?
A. Metasploit
B. Honeypot
C. Nessus
D. Nmap

Answers

Answer:

B. Honeypot

Explanation:

Honepots, like the name suggest, are sort of baits for the hackers. Honeypot pretty much decoys made to mimic the actual company computers. Hackers fall for it and think they hit jackpot. Once hackers try to extract info from the honeypot, the security analyst can either track the hackers to report to authorities or this is a way to distract hackers from the real protected data.

A UNIX or Linux system might identify a file as: /usr/imfst/flynn/inventory.doc. The first entry is a forward slash ( / ) representing the master directory, called the ____ directory. a.root b.working c.main d.branch

Answers

Answer:

C

i cant give you an explaination on why it is like that but C sounds and seems the correct one

A student is going to e-mail a file she has created and needs to reduce the file size. What tool should she use to reduce the file size?

save and send

macros

compress media

save as

Answers

Answer:

Compress media

Explanation:

This zips the file into a smaller size which can now be sent. It can be decompressed to view.

if a user watches a video with event tracking three times in a single session, analytics will count how many unique events?

Answers

Answer:

1

Explanation:

Analytics will count it a One (‘1’) Unique Event, even if a user watches a video with event tracking three times but in a single session.

A company has dedicated a subgroup of its development team to coding the exception handling aspects of an application. what is the significance of exception handling?

Answers

Exceptional handling is the program handling in unexpected circumstances. Exceptional handling is significant as the functions showing errors could be corrected.

What is exceptional handling?

In coding exceptional handling is the method to correct the errors in the function of the application program so that it does not get crash resulting in the loss of the task of the end-user.

It can be corrected by blocking, catching the handler, and by throwing expressions. The exceptions should be handled so that abnormal termination of the application is prevented.

Therefore, exceptional handling is significant to prevent program termination.

Learn more about exceptional handling here:

https://brainly.com/question/13261436

#SPJ1

Which subnet would include the address 192.168.1.96 as a usable host address?

Answers

The subnet for the address 192.168.1.96 will be 192.168.1.64/26.

What is a subnet?

The subnet in the host address is given as the logical subdivision or the partition of the IT network. It enables the computer systems to share the same internet.

The subnet for the address 192.168.1.96 will be 192.168.1.64/26. It is based on the increment with the octet it falls in.

Learn more about subnet, here:

https://brainly.com/question/15055849

#SPJ1

Which organization provides a free, online html5 validator application to ensure that a webpage's html tags follow the rules for html5?

Answers

The organization provides a free, online html5 validator application to ensure that a webpage's html tags follow the rules for html5 is the W3C.

What does the W3C do?

The W3C's is known to help to create protocols and rules that makes sure that long-term  development of the Web.

Therefore, we can say that The organization provides a free, online html5 validator application to ensure that a webpage's html tags follow the rules for html5 is the W3C.

Learn more about The W3C  from

https://brainly.com/question/11179793

#SPJ1

The main function of a(n) ____________________ is to centralize access control for the network by keeping an eye on both inbound and outbound traffic and preventing unauthorized users and malicious code from entering a network. .

Answers

Maybe the answer is “server”

how to transfer crypto from coinbase to coinbase wallet

Answers

Answer:

Open Coinbase Wallet on your mobile device.

Tap to go to your Settings.

Tap Buy or Transfer.

Select the supported crypto.

Enter the amount you want to transfer then tap Continue.

Follow the remaining steps to complete your transfer.

3.7 Code Practice
can someone write a code for me

Answers

Answer:

Explanation:

raaaaa faraon- yt:

love shady

Cloud Kicks wants a report Co categorize accounts into small, medium, and large based on the dollar value found In the Contract Value field. What feature should an administrator use to meet this request

Answers

The feature that the administrator can use to meet this request is known as Bucket Column.

What is a bucket column?

A bucket column is known to be formed when a person define a lot of categories (buckets) that are known to be used to group report values.

Therefore, The feature that the administrator can use to meet this request is known as Bucket Column. as one can report, sort, filter, and group via the use of bucket columns.

Learn more about accounts from

https://brainly.com/question/24756209

#SPJ1

Match the script file extension to the description. - .bat - .ps1 - .vbs - .sh - .py - .js a. Windows PowerShell script file b. Unix or Linux shell script file c. Windows batch file

Answers

Answer:

.bat = windows batch file

.ps1 = windows powershell file

.vbs = virtual basic script

.sh = unix or linux shell script file

.py = python file

.js = javascript file

you are running out of time and budget for your game development project you had great ideas for making a randomized highly customizable game experience with high levels of emerg but now you can only fit in the features of one of those qualities highly immersive highly randomize or highly customized briefly describe your imaginary games style then explain which of these three qualities would be best to implement in that type of game on a limited budget​

Answers

My games style  in terms of their qualities will be made up of:

Movement from Attack to Defense.Set up Defense.Movement from Defense to Attack. Set Pieces.

What is a game style?

Game style is known to be a term that is made or used by coaches, sports scientists, etc., to show the patterns of play in a scenario of team sports.

Therefore, My games style  in terms of their qualities will be made up of:

Movement from Attack to Defense.Set up Defense.Movement from Defense to Attack. Set Pieces.

Learn more about Games from

https://brainly.com/question/5144258

#SPJ1

A system engineer enhances the security of a network by adding firewalls to both the external network and the internal company network. The firewalls are products of two separate companies. This is an example of what type of security control practice?

Answers

Answer:

Vendor diversity

Explanation:

Different cybersecurity companies maintain different codebases, which means an exploit that might poke holes in the security of one likely won't breach the other. In this situation, the network would still have an active and effective firewall from one vendor even as the exploit from the other vendor's firewall is being patched.

list the parts of different engine.​

Answers

Answer:

here is the answer

Explanation:

The different parts that make up your car's engine consist of: the engine block (cylinder block), the combustion chamber, the cylinder head, pistons, the crankshaft, the camshaft, the timing chain, the valve train, valves, rocker arms, pushrods/lifters, fuel injectors, and spark plugs

Workplace ethics include playing games. looking up things on the internet that are not work related. taking care of personal business without permission during work time. doing the work you have agreed to do while at work.

Answers

Answer:

Doing the work you have agreed to do while at work

Explanation:

I'm not sure what exactly there is to explain. The other options are not things that should be done in the workplace

When running a spelling and grammar check, which of these options in the "not in dictionary"/suggestion area does nora need to select when she wants to fix an error? add to dictionary ignore once ignore all one of the suggested words

Answers

Answer:

ignore all one of the suggested words

Answer:  D: one of the suggested words

Explanation:mines from enginuity and this is what it said hope it helps:)

The date you type at the beginning of a letter or report should be the date that the document is _____.

Answers

The date that is typed at the beginning of a letter or report should be the date that the document is:

Written

What is the Date of a Letter or Report?

Typically, the first date that is seen at the beginning of a report a document often connotes the date of writing.

For instance, if the letter or report was written today, it will bear today's date. This will help the recipient to have a clear understanding of the time frame.

Learn more about letter writing here:

https://brainly.com/question/1155995

#SPJ4

Other Questions
question 7. evaluate the expression 3. Ramu finishes 1/3 part of a work in 1 hour. How much part of the work will be finished in 1 2/5 hours? how to solve to |12(1663)| can i get help with computer language 10 Events between the years 1500-present day True or False the question is good, there is no such thing as a bad question. Nutrients the body uses to build and maintain its cells and tissuesA.fatb.carbohydratec.proteind.fiberplease help. V. What volume of nitric oxide will diffuse out of a porous partition in 10 seconds when 25 ml of methane diffuse out in 4 seconds? why does the water in the rivers flatulate? Study the four maps of Africa and determine which map reveals the largest extent of African independence.Map A: Africa Administrative Divisions, 1954Map B: Africa Administrative Divisions, 1958Map C: European Colonial Powers, 1913Map D: Africa Administrative Divisions,1962 1. a motor car race is 500 miles long and consists of completing laps of a circular speedway that has a circumference of 2.5 miles. for which of these functions does y represent the number of miles a motor car has left to go in the race if x represent the number of laps completed by the motor car? a. y = -2.5x -500 b. y = -2.5x + 500 c. y = 2.5x -500 d. y = 2.5x + 500 the basic structural and functional unit of the human body is What shuffles genes and increases genetic variation in gametes during meiosis, when these homologous pairs are paired up ? speech on never ever give up Two electrons (-1.6 x 10-19 C) are separated by an insulator at a distance of 0.10 mm. Which of the following is the electrostatic force between these electrons? 2. Triangle EFG is a sketch of a triangular community garden that has an area of 47.1 square feet.Trigonometric area formula: Area = 1/2 a b sin(C)To the nearest foot, what amount of fencing is needed to surround theperimeter of the flower bed?G E F E= 45 degrees EF=12ft F=62 degrees Researching the average earnings by major and by career can help you determine the _____ of an institute of higher education. a) net cost b) sticker price c) available scholarships d) return on investment What is the best use of style manual for writing The hikers stopped to look at the view with Barney Gumble. Theytook many pictures. Which author is credited with writing the first detective story? john grisham.