#by chaing it's type using str() function
# We have a string and a integer
string1 = "superman"
num1 = 20
# concatenated string
concatString = string1 + str(num1)
print(concatString)
# In python you need to cast the variable to a string with str()
var = 3
print('Variable = ' + str(var) )
# 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))
number = [1,2,3,4,5]
number.reverse()
# to concatenate strings and int
# One needs to use str() to convert the string into int
print("Reverse list: "+ str(number))
string = 'string' for i in range(11): string +=str(i) print string