Knowledge organisersConcatenation and Basic Strings
Convert before joining.
You cannot concatenate a string and a number directly. Use str() to convert the number first, or use commas in print() which adds spaces automatically.
"Score: " + 10 causes TypeError"Score: " + str(10)print("Score:", 10) works — commas auto-convertstr() to cast numbers before concatenatingscore = 95
print("Score: " + str(score))
print("Score:", score)