163k views
4 votes
PLEASE HURRY!!!

After the following code is executed, what value is stored in weight?

>>> answer = input("What do you weigh? ")
What do you weigh? 105.7
>>> weight = float(answer)
>>> weight = weight + 3
The value stored in weight is .

User Tataelm
by
4.9k points

1 Answer

6 votes

Answer:

108.7

Step-by-step explanation:

When someone enters an answer, it's stored in the variable "answer" as a string. Then "weight" is set to the value of the string, converted to a floating-point number (meaning that it has a decimal value, instead of being an integer). At that point weight = 105.7, so when you add 3 to it you get 108.7.

User Calvin Fisher
by
5.2k points