79424985

Date: 2025-02-09 13:45:32
Score: 1
Natty:
Report link

Thanks to Elli's idea:

def find_all_indices(string, find):
  return [i for i in range(len(string)) if string[i:i+len(find)] == find]

print(find_all_indices('How much wood would a wood chuck a wood chuck wood?', 'wood'))
# [9, 22, 35, 46]
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ehsan Paknejad