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
While inspecting an element in the DOM on my website using the Chrome Devtools I accidentally deleted the DIV that had all my au
Kobotan [32]

Answer:

Refresh the page, it will reset all the underlying code.

Explanation:

Inspecting an element is essential for web developers in building websites faster and better. The Chrome DevTools is a powerful tool that is integrated into the Chrome browser to assist developers in on-the-go website troubleshooting.

Editing codes in the Chrome DevTools console does not affect the source code of the website hosted on a server, it just provides instant editing functions for troubleshooting or website enhancement.

Therefore, refreshing the page, re-loads the website again from its database which will show the unedited website. In our scenario, after refreshing the page, all the deleted DIV that contains all the authentication will reappear again.

4 0
3 years ago
Why is local hosting not suitable for a public website?
ruslelena [56]

Answer:

Because its only available to the host

Explanation:

8 0
2 years ago
What does your digital footprint say about you? Does your digital footprint
faust18 [17]
Your digital footprint says a lot about you. It represents your difference from everyone else and that you can’t be exactly like someone else. Your digital footprint also shows that there is one part of you that stays true to itself and never changes. It aligns with a purpose for almost everyone. That purpose is to be yourself because no matter how hard you try to be like someone else, something will always remain true to the real you.

Hope this helps. If this isn’t the type of answer you were looking for, I apologize.
7 0
3 years ago
During which part of geologic time were dinosaurs most common?
ANTONII [103]
The answer is C. Jurassic.
6 0
3 years ago
Read 2 more answers
How to resize an image in photoshop without losing quality.
castortr0y [4]

Answer:

Explanation:

Make sure resample is turned on

Turn on the chain link if you want the width and height to change together. If not, turn off the chain so that you can set your own width and height.

Choose your new size (you can choose to choose different measurement units by clicking on “inches”)

press ok

i hoped this helped!!!!!!!!

8 0
2 years ago
Other questions:
  • Within the hardware of the personal computer temporary memory is known as
    10·2 answers
  • Keyboard question: <br> How do I make the 'congruent to' symbol on this keyboard?
    8·1 answer
  • A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time.
    9·2 answers
  • Each row in a database is a set of unique information called a(n)
    8·2 answers
  • Find the basic period and basic frequency of the function g(t)=8cos(10πt)+sin(15πt)
    9·1 answer
  • Match the image to the view type in a presentation program. scroll bar tool bar status bar menu bar provides an array of buttons
    10·2 answers
  • Identify what a computer needs to
    14·1 answer
  • The terms Apps and Applications can be used interchangeably about software installed
    8·1 answer
  • How are the waterfall and agile methods of software development similar?
    13·1 answer
  • Identify the network and the host address in the ip address of 12.128.120.131 with a subnet mask of 255.128.0.0.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!