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
liberstina [14]
3 years ago
5

Python

Computers and Technology
1 answer:
xeze [42]3 years ago
3 0

Answer:

Following are the function to the Python Programming Language.

#define a function to read or crates the list

def GetUserValues():

 my_list=[]

 n=int(input("Enter range: "))

 for i in range(n):

   my_list.append(int(input(" :")))

 return my_list

#define a function to check the elements of the list

def IsListEven(mylist):

 #set the for loop

 for i in range(len(mylist)):

   #set if condition to check odd number

   if mylist[i]%2 !=0:

     #if condition is true retun false

     return False

 #otherwise return true

 return True

#define a function to check the elements of the list

def IsListOdd(mylist):

 #set the for loop

 for i in range(len(mylist)):

   #set if condition to check even number

   if mylist[i]%2==0:

     #if condition is true retun false

     return False

 #otherwise return true

 return True

#set variable to store list

l=GetUserValues()

#set if condition to check the function is true

if IsListOdd(l)==True:

 #then, print the message

 print("all odd")

#set elif condition to check the function is true

elif IsListEven(l)==True:

 #then, print the message

 print("all Even")

else:

 #otherwise print message.

 print("not even or odd")

<u>Output:</u>

Enter range: 5

:2

:4

:6

:8

:10

all Even

Explanation:

Here, we define a function "GetUserValues()" and inside the function.

  • Set the list data type variable "my_list" then, get input from the user in the variable "n".
  • Set the for loop which starts from 0 and end at the variable "n" then, get input from the user and appends inputs in the variable "my_list".
  • Then, we return list and close the function.

Then, we set a function "IsListEven()" and pass an argument "mylist" to check the elements is even or not, if the list elements is even then, return true otherwise, return false.

Then, we set a function "IsListOdd()" and pass an argument "mylist" to check the elements is odd or not, if the list elements is odd then, return true otherwise, return false.

Finally, we call and store the function in the variable "l" then, set conditions to check the list is even print "all even", if the is odd "all odd" otherwise, print "not even or odd".

You might be interested in
What do you think that private information like passwords pin number will be guarded or shared with the public? why?
konstantin123 [22]

The private information like passwords pin number will be guarded or shared with the public because it gives the first line of defense where it can act against any form of unauthorized access to a person's computer and personal information.

<h3>Why should you use passwords to protect private information?</h3>

Passwords is known to be that factor that tends to give the first line of defense against any form of what we call illegal access to your computer and also that of one's personal information.

Note that the stronger a password of a person is, the more protected one can say that one's computer will be from any kind of hackers and malicious software.

Therefore one need to or one  should maintain the use of a strong passwords for all accounts that are present on your computer.

Hence, The private information like passwords pin number will be guarded or shared with the public because it gives the first line of defense where it can act against any form of unauthorized access to a person's computer and personal information.

Learn more about passwords from

brainly.com/question/17174600

#SPJ1

4 0
1 year ago
Scenes that are shot outside are known as
Maru [420]

Answer:

Location shooting

Explanation:

Most films feature a combination of locations and studio shoots; often‚ interior scenes will be shot on a soundstage while exterior scenes will be shot on location second unit photographs is not considered a location shoot. before filming the location are generally surveyed in pre-production‚

a process known as location scouting and recce.

3 0
3 years ago
Suppose that each country completely specializes in the production of the good in which it has a comparative advantage, producin
djverab [1.8K]

Answer:

In  this case, the country that produces rye will produce 24 million bushels per week, and the country that produces jeans will produce 64  million pairs per week.

Explanation:

Total labor hour = 4 million hour

Number of bushes produce in 1 hour = 6

⇒total bushes produce = 6*4 = 24 million

∴ we get

The country that produces rye will produce 24 million bushels per week

Now,

Total labor hour = 4 million hour

Number of pairs produce in 1 hour = 16

⇒total bushes produce = 16*4 = 64 million

∴ we get

The country that produces jeans will produce 64  million pairs per week.

5 0
3 years ago
Two machines can finish a job in StartFraction 20 Over 9 EndFraction hours. Working​ alone, one machine would take one hour long
Alborosie

<em><u>Answer</u></em>

5 hours

<em><u>Explanation</u></em>

The two working together can finish a job in

\frac{20}{9}  \: hours

Also, working alone, one machine would take one hour longer than the other to complete the same job.

Let the slower machine working alone take x hours. Then the faster machine takes x-1 hours to complete the same task working alone.

Their combined rate in terms of x is

\frac{1}{x}    +  \frac{1}{x - 1}

This should be equal to 20/9 hours.

\frac{1}{x}  +  \frac{1}{x - 1}  =  \frac{9}{20}

Multiply through by;

20x(x - 1) \times \frac{1}{x}  +20x(x - 1) \times   \frac{1}{x - 1}  =  20x(x - 1) \times \frac{9}{0}

20(x - 1)  +20x = 9x(x - 1)

20x - 20+20x = 9{x}^{2}  - 9x

9{x}^{2}  - 9x - 20x - 20x + 20= 0

9{x}^{2}  - 49x  + 20= 0

Factor to get:

(9x - 4)(x - 5) = 0

x =  \frac{4}{9}  \: or \: x = 5

It is not feasible for the slower machine to complete the work alone in 4/9 hours if the two will finish in 20/9 hours.

Therefore the slower finish in 5 hours.

8 0
2 years ago
The specific term for expediting the delivery of software by breaking a task into smaller increments is called
Ksivusya [100]
Rapid Application Development is the specific term
8 0
3 years ago
Other questions:
  • The expressionvecCont.empty() empties the vector container of allelements.
    13·1 answer
  • Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect
    8·1 answer
  • La computadora es un medio de comunicacion moderno?
    8·1 answer
  • Which element appears within the top margin of the document but does not form the part of the body of the text?
    15·1 answer
  • Write a chemical reaction to show that nitric acid contains nitrogen​
    15·1 answer
  • Write a method that returns a version of the given array where all the 10's have been removed. The remaining elements should shi
    9·1 answer
  • What your favorite video game? (Put your user if you wanna play!)
    9·2 answers
  • Which web browser was created by Google?
    5·2 answers
  • few toffees were distributed among oriya , piyush and payal . priya got 3/8 , piyush and payal 1/8 and 1/2 of total toffees resp
    5·1 answer
  • The database cannot be migrated to a different engine because sql server features are used in the application’s net code. The co
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!