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
andrey2020 [161]
1 year ago
14

Read the following code used to calculate the weight of an item with two-pound packaging:

Computers and Technology
1 answer:
Veronika [31]1 year ago
7 0

When there is an error in the code, the function that should be used is A. float(); weight requires decimals

<h3>When is a code?</h3>

Computer code, or a set of instructions or a system of rules defined in a specific programming language, is a term used in computer programming (i.e., the source code). It is also the name given to the source code after a compiler has prepared it for computer execution.

A float is a number with a decimal place since it is a floating-point number. When greater precision is required, floats are employed. The provided value is transformed into a floating point number by the float() function. In this case, the code is used to calculate the weight of an item and the float function will be vital.

Learn more about programs and code on:

brainly.com/question/22654163

#SPJ1

You might be interested in
Which option is used to ensure the integrity and authenticity of a Word document but requires additional services to be availabl
mel-nik [20]

Answer:

Digital signature.

Explanation:

Digital signature is used to ensure the integrity and authenticity of a Word document but requires additional services to be available on the internal network.

This is important as it makes sure that the file is authentic and not malware.

3 0
3 years ago
Read 2 more answers
Where is the os stored on a smartphone?
Digiron [165]

The OS (Operating System) is stored in the ROM on a smartphone. Correct answer: C

ROM stands for Read Only Memory. It is a computer memory that does not require power to store it's data (non-volitile).  It's the Internal Memory where the OS is stored. It is partitioned into two parts, one for the OS and the rest for apps to use.

6 0
3 years ago
A mother takes her child to the pediatrician because her right eye is red, itchy, with a mucus discharge coming from the eye. Th
allochka39001 [22]

Answer:

H10.021

Explanation:

7 0
3 years ago
Technology progress so new needs can be satisfied
snow_lady [41]

Yes, that is definitely true.

7 0
3 years ago
Read 2 more answers
The is_positive function should return True if the number received is positive, otherwise it returns None. Can you fill in the g
poizon [28]
<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

8 1
3 years ago
Read 2 more answers
Other questions:
  • Marie can now edit her photos, send them in emails, print them on a printer, and use them as wallpaper on her computer. This is
    9·2 answers
  • Which command would you use to move a file from one location to another?
    6·2 answers
  • Which software application should be used to communicate in writing about an upcoming event?
    12·2 answers
  • The media is a phase that people often use to refer to:
    6·1 answer
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • How do you post a picture on brainly? How do you also lower the points to like 5,brainless to the first understandable answers
    10·1 answer
  • The Start menu on Windows computers changes based on actions performed by their users. True False
    15·2 answers
  • ​What is a combination of one or more related characters or bytes and is the smallest unit of data a user accesses?
    8·1 answer
  • Daniel has a list of numbers that are not in any order. He wants to find the order of the numbers with the help of a spreadsheet
    10·1 answer
  • !!! 20 points !!!!!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!