Why don't I need to use a string to print?

Okay, can anyone tall me why it’s not necessary to use the str function in picture-link below? first, second, third, and fourth are all numbers, so wouldn’t it be necessary to use str when printing?

Btw, sorry if this is not posted on the right place on the web. The instructions I followed pointed me to this place :man_shrugging:

print() will take any expression, including an operation.

print (6 + 7)           # 13
print (6 * 7)           # 42

The operation depends upon matching types.

print ('a' + 'b')       # ab

We would only use str() in the event one operand is a string object, and the other, not.

print ('a' + 1)         # TypeError

print ('a' + str(1))    # a1

Thank you! That makes sense!

1 Like