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]
4 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]4 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
THERES THIS USER ON HERE WHO IS TAKING ALL YOUR POINTS SO I DID THE SAME THING TO HER CUZ SHE DID IT TO ME...SO WHY DONT WE ALL
GaryK [48]

Answer:

That is so low and I don't understand why that's necessary for her to do. Smh.

Explanation:

8 0
3 years ago
Steve left his computer switched on in his room and went out to have breakfast. When he returned, he saw that the monitor had be
yanalaym [24]

Answer:

B

Explanation:

5 0
4 years ago
What device operates at the network layer (layer 3) of the osi model and forwards packets across computer networks?
Oksi-84 [34.3K]
Yup. D) Router. 


Good guess! (:
7 0
3 years ago
You have defined a scope on your DHCP server with the start address 172.16.1.1, end address 172.16.1.200, and prefix length 16.
Andre45 [30]

Answer:

B

Explanation:

prefix 16 got 255.555.0.0 subnet mask & 65,536 total host. so in your case it ill take 172.16.0.0 - 172.16.255.255 / subnet and your scope ill take the 172.16.1.1 - 172.16.1.200 . for the next subnet is 172.17.0.0 - 172.17.255.255 and same thing as your scope you ill take 172.17.1.1 - 173.17.1.200 . keep learning bro :)

7 0
3 years ago
Name an analog quantity other than temperature and sound
liq [111]
I know that this might be wrong but is it light?
6 0
4 years ago
Other questions:
  • Reading is the process of transferring data, instructions, and information from memory to a storage medium.
    15·1 answer
  • Checking authentication, checking authorization and access control, auditing systems, and verifying firewalls and other filters
    12·1 answer
  • Under what driving conditions will 2019 Nissan LEAF’s available Rear Cross Traffic Alert (RCTA) warn the driver if a vehicle is
    11·1 answer
  • What are the requirements to connect the Internet?<br>plz answer it.....​
    10·1 answer
  • Write a Java program that reads two numbers from the console. Based on the example in the textbook, write five methods (min, max
    14·2 answers
  • What was your favorite animals, game, photo, friends,
    7·2 answers
  • Here is what my rob-lox user USED to look like, btw what is better, Samsung or apple?
    13·2 answers
  • Guys is there a way to watch manga in colour for free
    13·1 answer
  • Business Rules constraints falls into two categories:
    7·1 answer
  • Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.Group of answer choi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!