79080155

Date: 2024-10-12 04:00:34
Score: 1
Natty:
Report link

A simple iteration can do it:

sentence = "This is a string"
s = "s"
print([idx for idx, i in enumerate(sentence) if i==s])
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: keria