- Get link
- X
- Other Apps
In Python, you can put two or more strings together to create a new string. This process is called string concatenation, and it's done using the "+" symbol. It lets you combine separate strings into a single one. For example, suppose we have two strings, "Hello" and "World". We can use the "+" sign to join them together : ``` greeting = "Hello" name = "World" message = greeting + " " + name print(message) ``` This will output the string "Hello World". Note that we have added a space between the two strings using a string literal " ". We can also concatenate strings using the "join" method. This method takes an iterable of strings and concatenates them with a specified separator. ``` fruits = ["apple", "banana", "orange"] separator = ", " fruit_string = separator.join(fruits) print(fruit_string) ``` This will output the string "apple, bana...