Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d1c8b7

Browse files
authored
Create string concatenation
1 parent 3725520 commit 6d1c8b7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

string concatenation

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
http://www.pythonforbeginners.com/concatenation/string-concatenation-and-formatting-in-python
2+
3+
When you use the curly braces or {} operators, they serve as place-holders for the variables you would like to store inside a string. In order to pass variables to a string you must call upon the format() method.
4+
5+
One benefit of using the format() method is that you do not have to convert integers into a string before concatenating the data. It will do that automatically for you. This is one reason why it is the preferred operator method.
6+
7+
Fname = “John”
8+
Lname = “Doe”
9+
Age = “24”
10+
11+
12+
print “{} {} is {} years old.“ format(fname, lname, age)

0 commit comments

Comments
 (0)