Python Practice › String Programs › Program 29
Combine two strings
Write a Python program to combine two strings into one.
Input
"abc", "def"
Output
abcdef abcdef abcdef
Approach
- Use
+.
Solution
a, b = "abc", "def"print(a + b, f"{a}{b}", "".join([a, b]))Output
abcdef abcdef abcdef
Learn the concept
New to this topic? Read the lesson, then come back.