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
3 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]3 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
What symbol precedes all structured references in formula autocomplete lists?
Zolol [24]
Structured references make it easier to use formulas with Excel tables by ... Use brackets around specifiers All table, column, and special item ...
4 0
3 years ago
Which of the following statements is false? Question 4 options: By convention class names begin with an uppercase letter, and me
amm1812

Answer:

Instance variables can be declared anywhere inside a class.

Although there isn't any rule to declare instance variables before methods, and they can be declared anywhere in the class, they cannot be declared inside method definitions of class.

///////////////////////////////////////////////////////////////////////////////////////////////////////////

<em>By convention class names begin with an uppercase letter, and method and variable names begin with a lowercase letter.</em> - True.

<em>Instance variables exist before methods are called on an object, while the methods are executing and after the methods complete execution.</em> - True.

<em>A class normally contains one or more methods that manipulate the instance variables that belong to particular objects of the class.</em> - True

8 0
3 years ago
Read 2 more answers
The default color scheme is called ____.
notsponge [240]
What program is this regarding?

If it's a Microsoft Office product, the default colour scheme is "office"
5 0
3 years ago
Which of the following refers to semitransparent text or a faint object that appears
Agata [3.3K]
<h2>Option D: Watermark refers to semitransparent text or a faint object that appears behind the document content.</h2>

Explanation:

Footer: This is a text which appears in the bottom of every page. Mostly page numbers and the name of the publisher or the company name will be in the footer.

Page Color: This represents the color of the page

Page border: This option provides border to the page. The border can be thin or thick according to the requirement.

Watermark: This is the right answer. A watermark is added such that your content cannot be used by anyone else without permission. When you copy the text, the water mark also gets copied, thus avoiding plagiarism.

4 0
3 years ago
____ is an easy way to invitation through a web page​
madreJ [45]

Correct Question:

_______ is an easy way to navigate through a web page. ​

Answer:

Scrolling.

Explanation:

The responsiveness of a webpage is an ability of the design to respond to the end user's digital device and screen size.

In Computer programming, a responsive web design makes it possible for various websites to change layouts in accordance with the user's digital device and screen size.

This ultimately implies that, a responsive design is a strategic approach which enables websites to display or render properly with respect to the digital device and screen size of the user.

Additionally, media queries are simple filter design that can be applied to cascaded style sheets(css).

Depending on the size of the viewport, media queries makes it easy to tweak styles depending on parameters such as width, orientation, height, resolution and display type of the device rendering the data

Hence, scrolling is an easy way to navigate through a web page. It avails the end users an ability to scroll (navigate) from side to side (left-right or right-left) and top to bottom (bottom-top) by using the horizontal and vertical onscreen scrollbars respectively.

3 0
3 years ago
Other questions:
  • 6.1.5: weather codehs
    13·1 answer
  • What are the three main purposes of an operating system? Explain how the old mainframe computers were different from the compute
    12·1 answer
  • Search engines enable you to
    14·1 answer
  • After a robbery, what is the purpose of conducting a neighborhood canvass?
    9·1 answer
  • Wide area networks are defined by their ability to
    14·2 answers
  • Which of the following methods is the easiest way to set up a VPN client on a computer for a user who is not technical?
    12·1 answer
  • Which routing protocol does an exterior router use to collect data to build its routing tables?
    8·1 answer
  • Most of the internal operations in a computer use hexagonal numbering true or false
    13·1 answer
  • 23. Convert the following to Megabytes<br> a) 2GB<br> b) 2056 Bytes-
    8·2 answers
  • Sara wants to set up her lights to turn on when she arrives home. She has heard that she might be able to do this using IoT. Wha
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!