From 39c86dc7226695027f4d0b435d1b9363283aedb8 Mon Sep 17 00:00:00 2001 From: Chris Cooper Date: Sun, 3 Sep 2023 13:16:59 -0700 Subject: [PATCH] Use f-string in encode function. --- python/0271-encode-and-decode-strings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/0271-encode-and-decode-strings.py b/python/0271-encode-and-decode-strings.py index ff02e079f..3d58a075b 100644 --- a/python/0271-encode-and-decode-strings.py +++ b/python/0271-encode-and-decode-strings.py @@ -1,6 +1,6 @@ class Codec: def encode(self, strs): - return ''.join(map(lambda s: str(len(s)) + '#' + s, strs)) + return ''.join(map(lambda s: f"{len(s)}#{s}", strs)) def decode(self, s): res = []