How to remove first occurrence of a letter?
I am assuming that you do not remove anything if the letter is not contained in the string, so you can use the following code:
Strictly not using splicing
new_string = ''
found = False
for i in range(len(remWord)):
if remWord[i] != remLetter or found:
new_string += remWord[i]
else:
found = True
If you are allowed to use splicing
new_string = ''
for i in range(len(remWord)):
if remWord[i] != remLetter:
new_string += remWord[i]
else:
break
new_string += remWord[i + 1:]