jazminislost
jazminislost jazminislost
  • 12-11-2020
  • Computers and Technology
contestada

What is the value of the variable moneyDue after these lines of code are executed?

>>> numSodas = 2
>>> costSodas = 1.50
>>> moneyDue = numSodas * costSodas

Respuesta :

handsomesquid807
handsomesquid807 handsomesquid807
  • 30-11-2020

Answer:

3.0

Explanation:

To understand why there is a blank decimal, we have to understand that when you add multiply or subtract with a float (in python), the result will also be a decimal, even you use a blank decimal in the equation. A circumstance where the output would just plain 3, you would have to put in the following:

>>>int(moneyDue)

To insure it will output an int. However, it does not use that line of code, thus proving the answer is 3.0.

hope this helped :D

Answer Link

Otras preguntas

The product of 5p2q and -4p3q4 is
a kilogram of atis costs 65.75 pesos, at that rate, how many kilograms can a costumer buy if he has 350.00 pesos?​
pleaseee help asapp tysm <3
What are trees? What are trees for?
The label on a soft drink bottle gives the volume in two units: 2.0 L and 67.6 fl oz. Use this information to derive a conversion factor between the English and
Which mental health issues can nicotine addiction lead to? Select three options.
determine the equation of the circle if its center is (8,-6) and which passes through the points (5,-2).
Drag each Image on the right to the Bitmap column if the Image is an example of a bitmap image or to the Vector column if the
Jared lost $3725 on his stock investment last year. Estimate his average loss each month.
How does our modern society value connection between people? Is this similar to how John Donne conceived of it?