From 529d797553cde4ced85f1729a28123106b333033 Mon Sep 17 00:00:00 2001 From: Steve De Jongh Date: Thu, 28 Oct 2021 09:16:46 +0200 Subject: [PATCH] String.format basic placeholders --- examples/string_format.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/string_format.py b/examples/string_format.py index 777c018..554a100 100644 --- a/examples/string_format.py +++ b/examples/string_format.py @@ -1,3 +1,15 @@ +# Basic placeholders + +ingredient = "sugar" +quantity = "500g" + +ingredient_string = "- {}: {}".format(ingredient, quantity) + +print(ingredient_string) + + +# Named placeholders + fname = "John" lname = "Doe"