173k views
0 votes
Which function converts a numeric value when concatenating with a string?

float()
int()
print()
str()

User Solosodium
by
5.7k points

1 Answer

2 votes

Answer:

The answer to this question is "str()".

Explanation:

In any programming language, the str() function converts a numeric value into a string. We use this function in python. The str() is a built-in function. which means we do not need to import this function. In python, we use this function with or without parameter. If we use the str() function with a parameter so it will return a string. The program of this function can be given as:

Program:

a = 5

print("Hello")

print(a)

print("The value of variable "+"is: " + str(a))

Output:

Hello

5

The value of the variable is: 5

User Tomas Kulich
by
6.2k points