A loooong type conversion

Report a typo

Look at some type conversions below and find out what will be in the output. Type the answer without quotes.

n = 2.777
print(str(float(int(n))))

Tip: When you convert a floating-point number to an integer, its fractional part is ignored, e.g. int(3.14) produces 3. The other way around, an integer takes on a trailing zero to become a float, e.g. float(3) equals 3.0. Quotes enclose your number converted to a string, but remember that they are not printed.

Enter a number
___

Create a free account to access the full topic