mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-12 15:06:45 +03:00
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:
committed by
GitHub
parent
784d54c4e2
commit
88875a82d3
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user