The output for the line of code int(2.8)
is:
2
The int()
function in Python converts a floating-point number to an integer by truncating the decimal part.
Multiple Choice
What is the output for the following line of code?
>>>int(2.8)
Responses
3
3
2.8
2.8
'2.8'
'2.8'
2
1 answer
The output for the line of code int(2.8)
is:
2
The int()
function in Python converts a floating-point number to an integer by truncating the decimal part.