Podcast
Questions and Answers
Which function can convert a floating point number or a string into an int?
Which function can convert a floating point number or a string into an int?
- str
- convert
- int (correct)
- float
What does the int function do with floating point numbers?
What does the int function do with floating point numbers?
- It discards the decimal portion of the number. (correct)
- It rounds them down to the nearest integer.
- It converts them into a string.
- It rounds them up to the nearest integer.
What happens when the int function is called with the argument '3.9999'?
What happens when the int function is called with the argument '3.9999'?
- It rounds it to 3.5.
- It rounds it to 4.
- It rounds it to 3. (correct)
- It rounds it to 3.9.
Which function can turn an integer, a float, or a syntactically legal string into a float?
Which function can turn an integer, a float, or a syntactically legal string into a float?
What type of error is raised when the int function is called with the argument '23 bottles'?
What type of error is raised when the int function is called with the argument '23 bottles'?
Flashcards are hidden until you start studying