Pythondex

Quiz

Input & Type Conversion Quiz

When using input() in Python, what is the data type of the value returned?

int
float
str
bool

Which function would you use to convert a string '10.5' to a floating-point number?

int()
float()
str()
bool()

If you want to combine a number and text in a print statement, what should you do?

Use + with str() to convert the number
Use * operator
Just add them directly
Use type()

Which of these is NOT a valid type conversion function in Python?

int()
float()
str()
num()