OneBite.Dev - Coding blog in a bite size

concatenate a string in python

Code snippet on how to concatenate a string in python

  s1 = "Hello"
  s2 = "World"
  s3 = s1 + " " + s2
  print(s3)

This code block shows how to concatenate two strings together in Python. First, two strings, s1 and s2, are defined. Then, s3 is defined as the combination of s1 and s2, with a space between them. Finally, the combined string is printed in the console. In this case, the output would be “Hello World”.

python