Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

concatanate string to integer in python

# You cannot concatanate a string to an integer
a = 'love'
b = 1
print(a + b)
# This will give a Type Error
# So convert the integer to a string and then you can concatenate
print(a + str(b))
 
PREVIOUS NEXT
Tagged: #concatanate #string #integer #python
ADD COMMENT
Topic
Name
3+8 =