36.3k views
2 votes
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

User Eric Boehs
by
6.2k points

2 Answers

1 vote

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.



User Markijbema
by
6.1k points
3 votes

str convert number into a string

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


User Tawab Wakil
by
6.5k points