multiple choice\nwhat is the output for the following line of code?\n>>>int(2.8)\n3\n2.8\n2\n2.8

multiple choice\nwhat is the output for the following line of code?\n>>>int(2.8)\n3\n2.8\n2\n2.8

multiple choice\nwhat is the output for the following line of code?\n>>>int(2.8)\n3\n2.8\n2\n2.8

Answer

Explanation:

Step1: Understand int() function

The int() function in Python truncates the decimal part of a floating - point number and returns the integer part.

Step2: Apply to 2.8

When we apply int() to 2.8, we discard the decimal part. So int(2.8) = 2.

Answer:

C. 2