String.format basic placeholders

This commit is contained in:
Steve De Jongh 2021-10-28 09:16:46 +02:00
parent e8f8aed3f5
commit 529d797553
1 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,15 @@
# Basic placeholders
ingredient = "sugar"
quantity = "500g"
ingredient_string = "- {}: {}".format(ingredient, quantity)
print(ingredient_string)
# Named placeholders
fname = "John"
lname = "Doe"