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
Which of the following are true if you pay only the minimun amount each month towards your credit card bill? You will be charged
torisob [31]

Both A and B are true. Check out this link: https://www.nerdwallet.com/blog/credit-cards/minimum-payment-credit-card/

I hope this helps!

6 0
3 years ago
What type of coverage pays for damage incurred as a result of theft, vandalism, fire or natural disaster?
Sloan [31]

Comprehensive or hazard insurance

5 0
3 years ago
Both successors to C++, _____ , by Sun Microsystems, and _______, by rival MicroSoft, are very similar.
Tanzania [10]

Answer: Java and Forth

Explanation:

   C ++ and Java are comparatively similar language which are composed statically, unequivocally, and obviously. Both language are the object-oriented and planned with the semi-interpretation and run-time during the compilation of the time.

Both uses the curly braces and also they are very similar language as compared with c# and c. Both the successors in the C++ , java and sun micro-system are similar in terms of Microsoft.

 

8 0
3 years ago
Why are your interactive ads so broken?
VladimirAG [237]

Answer:

lol truuuue

Explanation:

5 0
3 years ago
Which key combination will allow users to move to the top of a document? Ctrl+Page Down Ctrl+Home Shift+Home Shift+Page Up
Nonamiya [84]
It would be Ctrl+Home
5 0
3 years ago
Read 2 more answers
Other questions:
  • To change the background color of a page, which tab would you use?
    15·2 answers
  • What happens when a magnet is close to a iron nail?
    12·1 answer
  • A computer can sort x objects in t seconds, as modeled by the function below:
    5·1 answer
  • 1024 Megabytes = ____________
    14·1 answer
  • What is the correct name for the words Home, Insert, Design, Layout, References, etc. in the ribbon in Word 2016?
    8·2 answers
  • The function of anOR gate can best be described as a gate which provides an output of 1 only when
    10·1 answer
  • 6. You and your friends take an awesome selfie, and you add your name and addresses to the picture. It is a good idea to share t
    11·1 answer
  • ```{r}
    11·1 answer
  • 1. Fill in the blanks with appropriate word. 5°1-5 is a collection of raw unprocessed facts, figures, and symbols ​
    12·1 answer
  • How should your fingers rest upon the home row keys?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!