refactor: replace range(len(...)) with enumerate(...)

Using `range(len(...))` is not pythonic. Python does not have not index-based loops. Instead, it uses collection iterators.  Python has a built-in method `enumerate` which adds a counter to an iterable.
This commit is contained in:
deepsource-autofix[bot]
2024-01-14 14:18:20 +00:00
committed by GitHub
parent 784d54c4e2
commit 88875a82d3

View File

@@ -129,8 +129,8 @@ def main(config, debug: bool) -> None:
print("No channels found")
continue
for i in range(len(results)):
print(f"{i}: {results[i][1]} - Subs: {results[i][2]}")
for i, item in enumerate(results):
print(f"{i}: {item[1]} - Subs: {item[2]}")
print("5: Enter a custom channel ID")
print("6: Go back")