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
Before a program written in c can be executed on a computer, what step is required to be done first?
sergejj [24]
It should be compiled. It won't work if it's not compiled.
6 0
3 years ago
Select the proper ergonomic keyboarding techniques.
SCORPION-xisa [38]

Answer:

The correct options are;

-Position the keyboard directly in front and close to you so you don't have an excessive reach

-Keep your shoulders, arms, hands and fingers relaxed

-Position your wrists straight or in neutral position while typing

-Adjust your chair height and position so your feet rest flat on the floor, or add a footrest to compensate for a higher chair

-Adjust the keyboard height so that your shoulders can relax and your arms are straight in front of you

Explanation:

1) It is important to keep the fingers in a relaxed position when typing

2) Ensure to type in a tapping fashion when typing rather than pressing on the keys of the keyboard

3) The fingernails should be kept short when frequent typing is done

4) The wrist is better kept above the keyboard than resting on it

5) Ensure that the mouse is easily reached.

4 0
2 years ago
In a _error,solution is working but not giving required results
drek231 [11]

Answer:

<h2>it is a random error </h2>

Explanation:

<h3>I HOPE THAT THIS ANSWER HELPS YOU </h3>
7 0
2 years ago
What does N represent when analyzing algorithms?
Mademuasel [1]

Answer: "N" is considered as the size of the input that is being given in the algorithm.

Explanation: During a problem solving process , a algorithm is used to analyze the problem . Many function and  steps are to be taken care of while analyzing algorithm. Among analyzing step, input is also given which is usually zero more than that . An input has a certain size which is given by the initial "N".  The input size defines the length of the string for the input.

4 0
3 years ago
A ______ system writes data on two or more disks simultaneously, thereby creating a complete copy of all the information on mult
Mrrafil [7]

A raid 1 and mirrored system writes data on two or more disks simultaneously, thereby creating a complete copy of all the information on multiple drives.

<h3>What is Disk mirroring?</h3>

In data storage, disk mirroring is a term that connote the doubling of logical disk volumes into a different physical hard disks so that it will always be available.

Conclusively, Note that this is mostly used in RAID 1. A mirrored volume is known to be full logical depiction of separate volume copies and as such the answer above is correct.

Learn more about system from

brainly.com/question/25594630

8 0
2 years ago
Other questions:
  • during zach's second visit of the year, he incurred a $450 bill. Describe how much is paid by Zach and the insurance carrier
    7·1 answer
  • 3n - 12 = 5n - 2<br> how many solutions?
    15·1 answer
  • _____________________________________________________is a pre-designed format to help users with the creation of a document, lik
    6·1 answer
  • Will give brainly if answer all or my questions
    8·1 answer
  • PLZZZZZZZZZZZZZZZ HELP ME OUT!!!!! I SICK AND TIRED OF PEOPLE SKIPING MYQUESTION WHICH IS DUE TODAY!!!!
    14·1 answer
  • Which tool allows users to share code and also serves as a social networking
    10·1 answer
  • Write in language C, please.
    8·1 answer
  • A(n) __________ structure is a structure that causes a statement or a set of statements to execute repeatedly.
    13·1 answer
  • What is a disadvantage of communicating on social media?
    14·1 answer
  • The designers of a database typically begin by developing a​ __________ to construct a logical representation of the database be
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!