You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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