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
MissTica
2 years ago
11

Write a function called is_even that takes one parameter and returns a boolean value. It should return True if the argument is e

ven; it should return False otherwise.
The is_even function should not print anything out or return a number. It should only take in a number and return a boolean.

Note: Be sure to include comments for all functions that you use or create.

For example, if you made a call like

is_even_number = is_even(4)
is_even_number should have the value True.

Once you’ve written this function, write a program that asks the user for integers and prints whether the number they entered is even or odd using your is_even function. You should let the user keep entering numbers until they enter the SENTINEL value.

Here is a sample run of the program:

Enter a number: 5
Odd
Enter a number 42
Even
Enter a number: -6
Even
Enter a number: 0
Done!

(CODEHS, PYTHON)
Computers and Technology
1 answer:
Nikitich [7]2 years ago
6 0

def is_even_number(n):

   return True if n % 2 == 0 else False

while True:

   number = int(input("Enter a number: "))

   if number == 0:

       break

   else:

       if is_even_number(number):

           print("Even")

       else:

           print("Odd")

I wrote my code in python 3.8. I hope this helps.

You might be interested in
Why do so many people think the revision stage is the hardest
tia_tia [17]

It is because many people want to be perfect just at the start, but there is always room to improvement, but people don't accept that, so they don't want to be better than what they are already, so the don't revise themselves or anything.


6 0
3 years ago
Read 2 more answers
Which of the following is an example of a complex formula?
myrzilka [38]

Answer:

=A1<=A14

Explanation:

complex formula in excel is which contain more than 1 mathematical operators . An order of mathematical operations are important to understand

there are different type of operators

  • Arithmetic operators
  • Comparison operators
  • Text operators
  • Operators reference

here Comparison operator is an example of complex formula . Comparison operator returns TRUE/FALSE it is use to compare two values

= Equal to

< Less than

> Greater than

>= Greater than or Equal to

<= Less than or Equal to

7 0
3 years ago
When using _____, developers are required to comply with the rules defined in a framework. (Points : 2) inheritance
Nikolay [14]

Answer: Contracts

Explanation:

The contract is the mechanism which is basically used by the developers to follow the set of rules that is defined in the framework with the proper specification in the API ( Application programming interface).

The contract is the proper agreement between the two and more developers so that they must follow the rules that is mentioned in the agreement contract.  

The contract is widely used in the software development process in which all the possible design requirement are mentioned according to the needs of the client.

Therefore, Contract is the correct option.

7 0
3 years ago
Which decimal value (base 10) is equal to the binary number 1012?
GaryK [48]

Answer:

The decimal value of 101₂² base 2 = 25 base 10

Explanation:

The number 101₂² in decimal value is found as follows;

101₂ × 101₂ = 101₂ + 0₂ + 10100₂

We note that in 101 + 10100 the resultant 2 in the hundred position will have to be converted to a zero while carrying over 1 to the thousand position to give;

101₂ + 0₂ + 10100₂ = 11001₂

Therefore;

101₂² =  11001₂

We now convert the result of the square of the base 2 number, 101², which is 11001₂ to base 10 as follows;

Therefore converting 11001₂ to base 10 gives;

11001₂= 1 × 2⁴ + 1 × 2³ + 0 × 2² + 0 × 2 ¹ + 1 × 2⁰

Which gives;

16 + 8 + 0 + 0 + 1 = 25₁₀.

7 0
3 years ago
Which of the follow represents a form of disruptive technology? Tend to open new markets and destroy old ones A new way of doing
RSB [31]

Answer: All of the above are included

Explanation: Disruptive technology is the created for the manipulation of the business operations and related components significantly.It works by changing the habits of the business system by its more superior standards and ways.

The opening of new market to eliminate the older market, invoking in the marketplace for cheap range of goods and making a new strategy that does not fulfill the demand of the customer are disruptive strategy as they change the regular way of business operation through their techniques.

4 0
3 years ago
Other questions:
  • Outline a scenario in which you might be acting ethically but might still want to remain anonymous while using the Internet. How
    14·1 answer
  • What is meant by encapsulating semaphores? Bring out the need for it
    12·1 answer
  • Could someone give an example or tell me what all of these mean? (For internet source citing) Evaluation: • Domain Name: • Autho
    7·1 answer
  • What is the meaning of 4 8 15 16 23 42?
    14·1 answer
  • Anyone down to play gta later i play on ps4?
    15·2 answers
  • Miriam Is a network administrator. A few employees want to access sensitive Information stored on a backup device. She wants to
    13·1 answer
  • How does calculate() work?
    6·2 answers
  • Anyone who do bug bounty hunt ?​
    10·1 answer
  • Examples of how the development of coding changed the way we live. What type of technology was created as a result of code?
    10·1 answer
  • In your own opinion how comes the surface grinding machine is called a highly accurate machine tool?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!