Articles → Python → Concatenate String In Python
Concatenate String In Python
Syntax
Example
welcome = "Welcome"
firstname = "Karan"
lastname ="gupta"
fullmessage = welcome +" " + firstname + " "+ lastname
print (fullmessage)
Concatenating Substring
welcome = "Welcome"
firstname = "Karan"
lastname ="gupta"
fullmessage = welcome[0:1] +" " + firstname[0:1] + " "+ lastname[0:1]
print (fullmessage)