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

How do I determine the angles of a triangle if only given 1 angle?
What are some of the major bodies of water in Canada?
What did Niccolo Machiavelli write and what was it about? a. to purify the church and return it to the people b. the buying and selling of church positions c. T
what is the capital of Mexico? a. Quito b. Panama City c. Guatemala City d. Mexico City
Can someone help fill the blank spaces out please? 13 points? If a wire gets too hot it may melt. A __________ is a piece of wire that _____ if the current gets
a small female gorilla weighs 68 kilograms.how much does she weigh in grams
How would you work out this equation? 4x+3y=-23 -2x-3y=25
What animal has two brains?
a small female gorilla weighs 68 kilograms.how much does she weigh in grams
HELP ME DO THIS y=2x+4 -5x-5y=-5