Make it work for older python versions

This commit is contained in:
Ammar64
2024-11-07 19:45:02 +02:00
parent 943e8381ee
commit 83f8bf5370
+1 -1
View File
@@ -93,7 +93,7 @@ def main():
longest_str = len(max(unsorted, key=len)) longest_str = len(max(unsorted, key=len))
for j in range(len(sorted)): for j in range(len(sorted)):
color = sorted[j] != unsorted[j] 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 all_sorted = False
if not all_sorted: if not all_sorted: