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
Mumz [18]
3 years ago
14

The is_positive function should return True if the number received is positive, otherwise it returns None. Can you fill in the g

aps to make that happen?
Computers and Technology
2 answers:
poizon [28]3 years ago
8 1
<h2>Question:</h2>

The is_positive function should return True if the number received is positive, otherwise it returns None. Can you fill in the gaps to make that happen?

<em>def is_positive(number):</em>

<em>        if  _____ :</em>

<em>            return _____</em>

<em />

<h2>Answer:</h2>

def is_positive(number):

   if (number > 0):

       return True

  else:

       return "None"

---------------------------------------------------------------------------------

<h2><u>Code Test and Sample Output:</u></h2>

print(is_positive(6))

>> True

print(is_positive(-7))

>> None

<h2></h2><h2> </h2>

----------------------------------------------------------------------------------

<h2><u>Explanation:</u></h2><h2><u></u></h2>

The code above has been written in Python.

Now, let's explain each of the lines of the code;

Line 1: defines a function called <em>is_positive </em>which takes in a parameter <em>number. </em>i.e

<em>def is_positive(number):</em>

<em />

Line 2: checks if the number, supplied as parameter to the function, is positive. A number is positive if it is greater than zero. i.e

<em>if (number > 0):</em>

<em />

Line 3: returns a boolean value <em>True </em> if the number is positive. i.e

<em>return True</em>

<em />

Line 4: defines the beginning of the <em>else</em> block that is executed if the number is not positive. i.e

<em>else:</em>

Line 5: returns a string value "None" if the number is not positive. i.e

<em>return "None"</em>

<em />

All of these put together gives;

===============================

<em>def is_positive(number):</em>

<em>    if (number > 0):</em>

<em>        return True</em>

<em>    else:</em>

<em>        return "None"</em>

<em>================================</em>

An example test of the code has also been given where the function was been called with an argument value of 6 and -7. The results were True and None respectively. i.e

print(is_positive(6))   = True

print(is_positive(-7))  = None

Benzema3 years ago
0 0

def is positive number
is number > 0
return True
else :
return False

You might be interested in
A ___ is an online collaborative event that may include such features as chat, slideshows, and PowerPoint presentations.
german

Answer:

I think Microsoft Teams

Explanation:

Microsoft Teams. Teams is a chat-based collaboration tool that provides global, remote, and dispersed teams with the ability to work together and share information via a common space. You can utilize cool features like document collaboration, one-on-one chat, team chat, and more. Microsoft Teams is also fully integrated with many other Office 365 services, such as Skype, SharePoint, Exchange, and Yammer.

5 0
3 years ago
Which devices are most likely to communicate with the internet? Select 3 options.
Anon25 [30]
<h2>Answer:</h2>

<h3>smart phone </h3>

<h3>cars </h3>

<h3>delivery trucks</h3>
5 0
3 years ago
A circuit has a resistance of 300 ohm and a current of 0.024 A. What is the voltage in the circuit?
fomenos
**Formula

If u want to calculate voltage:
Current x Resistance

so the answer is D

Current:
Voltage ÷ Resistance

Resistance:
Voltage ÷ Current
7 0
3 years ago
Is Bluetooth considered a computing innovation?
Scilla [17]

Answer:

yes it is becauuse through bluetooth i can play cod mobile on my phone wiith my ps4 controller

Explanation:

A Bluetooth device works by using radio waves instead of wires or cables to connect with your cell phone, smartphone or computer. Bluetooth is a wireless short-range communications technology standard found in millions of products we use every day – including headsets, smartphones, laptops and portable speakers.

8 0
3 years ago
Draw a flowchart and write pseudocode to represent the logic of a program that allows the user to enter values for the width and
n200080 [17]

Answer:

10. Start

20. Enter Width of the room (W)

30. Enter length of the room (L)

40. LET Area = L * W

50. Output Area

60. End

Explanation:

The flowchart is attached to this answer as an attachment.

7 0
4 years ago
Other questions:
  • Write a program to help you feed your friends at a party by doing some math about square pizzas. Assume the grader defines a str
    12·1 answer
  • ?trophic levelNYIGVU.;/IO9YK7,'0;
    12·1 answer
  • What is the use of html in websites
    15·2 answers
  • Kindly answer in Just 7,8 lines please
    7·1 answer
  • What is a sloper
    11·1 answer
  • Which of the following is a scam where perpetrators promise high pay for working on different projects like wooden calendars, pa
    13·1 answer
  • A security administrator is reviewing the following information from a file that was found on a compromised host: Which of the f
    9·1 answer
  • Gina, an IT professional, noticed that the servers were running very slowly. She evaluated the system and made a recommendation
    9·2 answers
  • The main work area of the computer is the
    14·2 answers
  • Suppose you made an error while creating your document. You used the word b. Find and Replace dialog box "SDAM" instead of "SIMA
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!