From 4807072894b4c8fcbc9a4f7bd073b127699db132 Mon Sep 17 00:00:00 2001 From: lightmare Date: Sat, 18 Feb 2023 19:09:25 +0000 Subject: [PATCH] Using zfill in utils.pad --- src/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/utils.py b/src/utils.py index 2cdbef7..236a129 100755 --- a/src/utils.py +++ b/src/utils.py @@ -120,11 +120,7 @@ def setup_args(): return args def pad(num, zeroes): - s = "" - for i in range(zeroes,0,-1): - if num < 10 ** i: - s = f"{s}0" - return f"{s}{num}" + return str(num).zfill(zeroes+1) def generate( text,