How do I concatenate two integer numbers in Python? For example, given 10 and 20, I'd like a returned value of "1020".
10
20
"1020"
Cast both to a string, concatenate the strings and then cast the result back to an integer:
z = int(str(x) + str(y))
2.1m questions
2.1m answers
60 comments
57.0k users