From e8f8aed3f520097aa901c0415213ae0215f83b79 Mon Sep 17 00:00:00 2001 From: Steve De Jongh Date: Wed, 27 Oct 2021 20:11:34 +0200 Subject: [PATCH] Added String.format example --- examples/string_format.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 examples/string_format.py diff --git a/examples/string_format.py b/examples/string_format.py new file mode 100644 index 0000000..777c018 --- /dev/null +++ b/examples/string_format.py @@ -0,0 +1,6 @@ +fname = "John" +lname = "Doe" + +bond_string = "My name is {lastname}, {firstname} {lastname}".format(firstname=fname, lastname=lname) + +print(bond_string)