5 Questions
Which function can convert a floating point number or a string into an int?
int
What does the int function do with floating point numbers?
It discards the decimal portion of the number.
What happens when the int function is called with the argument '3.9999'?
It rounds it to 3.
Which function can turn an integer, a float, or a syntactically legal string into a float?
float
What type of error is raised when the int function is called with the argument '23 bottles'?
ValueError
Test your knowledge of Python's int, float, and str functions with this quiz! Learn how these type converter functions can convert arguments into int, float, and str types, including the process of truncation towards integers.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free