String.format basic placeholders
This commit is contained in:
parent
e8f8aed3f5
commit
529d797553
|
@ -1,3 +1,15 @@
|
||||||
|
# Basic placeholders
|
||||||
|
|
||||||
|
ingredient = "sugar"
|
||||||
|
quantity = "500g"
|
||||||
|
|
||||||
|
ingredient_string = "- {}: {}".format(ingredient, quantity)
|
||||||
|
|
||||||
|
print(ingredient_string)
|
||||||
|
|
||||||
|
|
||||||
|
# Named placeholders
|
||||||
|
|
||||||
fname = "John"
|
fname = "John"
|
||||||
lname = "Doe"
|
lname = "Doe"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue