The output:
23
On the other hand, to convert an integer to a string, use the str() built-in method. This method takes an integer (or other data types) as an input and produces a string as an output.
Example:
average_score = 40
print(str(average_score)+" points")
The output:
40 points
How about failing to use the str() method?
average_score = 40
print((average_score)+" points")
The output:
Traceback (most recent call last):
File "C:\Users\Users1\sample1.py", line 3, in <module>
print((average_score)+" points")
TypeError: unsupported operand type(s) for +: 'int' and 'str'
It will output an error.