From 399ddc8ffdb060ef34fc18b905d84ec3cb3360f5 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 30 Nov 2022 17:19:49 +0000 Subject: [PATCH] Test string formatting. --- main.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 9622c8f..eb664c5 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,8 @@ #String tests -a = " !Hello World! " -print(a.upper()) -print(a.lower()) -print(a.strip()) -#strip(str_of_targ) -print(a.strip((" !"))) -print(a.replace("H", "J")) -print(a.split(" ")) +a = " !{} {}! " +b = " !{1} {0}! " +c = "hello" +d = "world" +print(a.format(c, d)) +print(b.format(c, d)) +print(b.format(d, c, a))