Python's enumerate() built-in function is perfect for iteration with indexing.
Forget about manually incrementing indexes; with enumerate(), you can start the index at any number using the (optional) "start" keyword. 😍
No more index += 1, use enumerate()!
nba_players = ["LeBron James", "Kevin Durant", "Stephen Curry"]
for index, player in enumerate(nba_players, start=1):
print(f"{index}: {player}")
# Outputs:
# 1: LeBron James
# 2: Kevin Durant
# 3: Stephen Curry
#built-ins #enumerate