Introduction
In this blog, I will explain about combining the two strings together in Python. In this blog, I am going to display the combining of the string with the distance.
Software Requirement
Python 3.5.2
Simple Programming
- a="C#"
- b="Corner"
- print("Value of A:",a)
- print("Value of B:",b)
- print(a+b)
- print(a+b+" is to learn New technology")
- print("%s %s" %(a,b))
- print("%s %10s" %(a,b))
Explanation
In the code, I have typed the A value and B value, followed by having code as the value of a and value of b. The values of a and b are combined (a+b) and in the condition, I have added another word to print (a+b+" some text").
In the program, I have given the %s, which is used to give the space of the words. If we need 10 spaces for the word, we have to give the %10s and it will take the space.