append string variable with integer python 1

append string variable with integer python

#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)

Here is what the above code is Doing:
1. We have a string and a integer
2. We are concatenating the string and the integer
3. We are printing the concatenated string

Similar Posts