Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 428 Bytes

File metadata and controls

29 lines (20 loc) · 428 Bytes

TypeError: can only concatenate str (not "int") to str

Occurs when trying to concatenate a string with an integer.

Reproduce

value = "10"
result = value + 5
print(result)

Error Message

TypeError: can only concatenate str (not "int") to str

Fix

value = "10"
result = int(value) + 5
print(result)

Reflection

Mixed string and integer without noticing the type difference.