From 83f8bf53704eecb32d2bf5889af165e0162dce20 Mon Sep 17 00:00:00 2001 From: Ammar64 Date: Thu, 7 Nov 2024 19:45:02 +0200 Subject: [PATCH] Make it work for older python versions --- ensure_sorted.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ensure_sorted.py b/ensure_sorted.py index 04951ee..dbf2818 100755 --- a/ensure_sorted.py +++ b/ensure_sorted.py @@ -93,7 +93,7 @@ def main(): longest_str = len(max(unsorted, key=len)) for j in range(len(sorted)): color = sorted[j] != unsorted[j] - print(f' {bcolors.RED if color else ''}{unsorted[j]}{bcolors.ENDC if color else ''}{((longest_str-len(unsorted[j]))+2) * ' '}{bcolors.GREEN if color else ''}{sorted[j]}{bcolors.ENDC if color else ''}') + print(f' {bcolors.RED if color else ""}{unsorted[j]}{bcolors.ENDC if color else ""}{((longest_str-len(unsorted[j]))+2) * " "}{bcolors.GREEN if color else ""}{sorted[j]}{bcolors.ENDC if color else ""}') all_sorted = False if not all_sorted: