Nov 30, 2016
2 mins read
Python String Concatenation is the process for joining small string to make the bigger. For example, you can create a full name by joining two string-like Firstname and Lastname. Formatting will help to display variable in or end of the string.
Python provides the easy way to concatenate Strings by using + (plus) and * (star) Sign. There are other methods such as append(), join() and format().
Here is an example :
|
|
Here is an example :
|
|
You might have the experience to use C language to print String and Integer using %s and %d. Python has similar string formatting to create new, formatted strings. The % operator is used to format variables.
|
|
String formatting using two and more than values using the tuple. A tuple is a sequence of immutable Python objects. Tuples use parentheses.
|
|
Python is supporting other function like append and join to manipulate String data.
Related Python Articles:
Read JSON File using Python Code and Prompt
JSON Pretty Print using Python- with Examples
Check out this Python code Formatter
Sharing is caring!