Quick actions

cmd+k|ctrl+k

Navigation

Languages

TypeErrorConcatenation

Snippet info

Language

Python

Visibility

public

Author

masterhun

Created

2023-09-13T20:59:03.40775Z

Updated

2023-09-13T20:59:38.339325Z

print("TypeError & Concatenation")

string_value = "ABC"

integer_value = 123

new_string = string_value + integer_value
# TypeError exception is thrown/raised.

# new_string = string_value + str(integer_value)
# TypeError exception is NOT thrown/raised.
# Calling the str() function removes the TypeError. 

print(new_string)
INFO