124k views
2 votes
Suppose your user entered a weight of 115.6. What will be the result of the following code?

strWeight = input("Enter your weight in pounds: ")
weight = int(strWeight)
print (weight)

115

115.6

116

An error occurs.

User Karthick M
by
5.2k points

2 Answers

1 vote

The answer is 115.

An integer cannot contain decimals points and it rounds down to the nearest whole number.

User Krishna Sapkota
by
4.5k points
4 votes

Answer:

An error occurs.

Step-by-step explanation:

Answer on edge 2020

User BruceCui
by
4.7k points