25.1k views
0 votes
What will you see on the next line?
>>> int(13.6)

User Azra
by
5.0k points

2 Answers

3 votes
Answer:
13

I hope this helped :)
User Janice
by
5.4k points
3 votes

Answer:


\huge\boxed{\texttt{13}}

Step-by-step explanation:

If we input
\texttt{int(13.6)} into bash (say python3), we will return with 13.

Why?

The
\texttt{int()} function of python basically stands for integer. It will convert whatever is inside the parentheses to an integer. This works with strings as well, and can be useful for turning strings into numbers readable by a program.

An integer is any real whole number (like -2048, 0, or 6, etc.) However, Python does not round the number based on whether it's closest to one value or not. Python always rounds down, basically what it does is takes away the decimal from the number.

If you would like to round to up, however, you might have a program that does this.


\texttt{import math}


\texttt{int(math.ceil(5.7))}

Hope this helped!

User JarrettV
by
5.6k points