Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

multiple choice what is the output for the following line of code? >>>i…

Question

multiple choice
what is the output for the following line of code?

>>int(2.8)

3
2.8
2
2.8

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