What is the purpose of the str() function?

A. A cable that connects a computer to hardware
B. A method of threading code into a computer
C. A system of organizing strings alphabetically
D. A way to print a numeric value with a string literal

Respuesta :

str convert number into a string

so ans is D. A way to print a numeric value with a string literal


The str() function is used in C, C+, Python and other programming languages. The exact purpose varies in different languages but it is always related to numerical numbers and character strings.


So the best answer is D. A way to print a numeric value with a string literal.