I don't know why but the code I wrote isn't running. I'm trying to generate a random index and deleting it from the string. It's not giving me an error message so I don't know what's wrong. Here's what I have:
def delete_randomly(string):
i = 0
while i < len(string):
if string[i] == randint(0, 10):
return string.remove(string[i])