Vidyalelo
Python · Q4

MCQs for Python Data Types and Numeric Types Chapter

Programming · Python · question 4

Q4

What is the purpose of the str() function in Python?

A.
To convert a string to a number
B.
To format strings
C.
To concatenate strings
D.
To convert a number to a string
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
The str() function converts a number or other data type to a string.