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
tiny-mole [99]
3 years ago
10

Write a function call it isEvenPositiveInt which takes an integer x and return true if x is positive and also even. Note isinsta

nce(x, int) will return True if x is an integer
So

>>> isinstance (23, int)

True

>>> isinstance (12.34, int)

False

>>> isinstance (12.34, float)

True
Computers and Technology
1 answer:
Anna11 [10]3 years ago
5 0

Answer:

The program to this question as follows:

Program:

def isEvenPositiveInt(x): #defining method isEvenPositiveInt

   if x>0: #checking number is positive or not

       if x%2==0: #check true condition

           return True #return value True

       else:

           return False #return value False

   return False #return value False

print(isEvenPositiveInt(24)) #calling method and print return value

print(isEvenPositiveInt(-24)) #calling method and print return value

print(isEvenPositiveInt(23)) #calling method and print return value

Output:

True

False

False

Explanation:

In the above Python program, a method "isEvenPositiveInt" is defined, that accepts a variable "x" as its parameter, inside the method a conditional statement is used, which can be described as follows:

  • In the if block the condition "x>0" is passed, that check value is positive, if this condition is true, it will go to another if block.
  • In another, if block is defined, that checks the inserted value is even or not, if the value is even it will return "true", otherwise it will go to the else part, that returns "false".  
You might be interested in
Planet X is a terrestrial planet in our solar system. It has 21% oxygen in its atmosphere. Humans can walk on this planet withou
Arte-miy333 [17]
Based on the given description above, the planet that is being described would be planet EARTH. It is the only planet where humans can walk without the aid of a space suit, and the only planet that can provide humans the necessary oxygen to survive. Hope this answers that question.
8 0
3 years ago
Read 2 more answers
You have purchased an LED monitor and connected it to the HDMI port on your computer using an HDMI cable. You configure the scre
Feliz [49]

Answer:

Change the screen resolution to the native resolution of the monitor

Explanation:

Every monitor has a native resolution that shows pixels and colors best. Modern monitors are usually 1920x1080 or higher. If the resolution given to the monitor is not native to the monitor, then the pixels on the screen will appear pixelated or distorted.

7 0
2 years ago
Is there such a thing as an ethical reason for unauthorized access to a computer system?
OLga [1]

Meaning of key word here is "unauthorized": We don't have access to use the system. But you are try to accessing an Unauthorized system which is illegal, can be ethical. I think, although not legal in point of where you have to decide of right and wrong. Like if you want to getting information from criminals personal file to catch him then i would be right.

Yes if an administrator want to fix a problem something going on in his/her network wrong,then he/she can access the systems which is attached to network. Like if somebody is trying to access your's network or wifi getting password then you can stop to them use ethically,stop her/him system access to attaching your's network.

6 0
3 years ago
List two use of a word processor software.<br>​
Fed [463]

Explanation:

the Word processor is used to for

* Editing of documents

*Formatting of documents

*Creation of documents

*Saving documents

5 0
3 years ago
Which of the following best explains why property rights are necessary in a
11Alexandr11 [23.1K]

Answer:

A. Property rights allow consumers and producers to make free

choices.

Explanation:

If the consumers and the producers have the properties, then only they can say that well this is free for you, or in other words, can make the free choices. And by no means market forces only work when everyone owns some property, as some also cannot have the property, and hence work hard to earn some property, and thus the Market force does work. And the laws have nothing to do with the free market or the non-free market. And as we saw above, the competition can exist if someone owns the property, and others do not. Hence, the correct answer is A.

5 0
3 years ago
Other questions:
  • 3. The following code will not display the results expected by the programmer. Can
    12·1 answer
  • How does modularity provide flexibility in a structured programming design?
    6·1 answer
  • What is a correlation and how does it relate to inferential error?
    5·1 answer
  • Int [] val = { 3, 10, 44 };
    12·1 answer
  • Traditionally, remote administrative access on routers was configured using Telnet on TCP port 23. However, Telnet was developed
    8·1 answer
  • True or False <br><br> Rootkits are only made by black-hat hackers.
    8·1 answer
  • Examples of application software​
    7·2 answers
  • 1. It is a set of integrated devices that input, output,
    11·1 answer
  • What is one way to process your thoughts about the information you are reading?
    15·1 answer
  • Explain why it is important that the device registration is the last thing that is done in the initialization routine of a devic
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!