We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
we can do it two ways as they provided
def mutate_string(string, position, character):
string = string[:position]+character+string[position+1:]
return string
Mutations
You are viewing a single comment's thread. Return to all comments →
we can do it two ways as they provided def mutate_string(string, position, character): string = string[:position]+character+string[position+1:] return string
and
def mutate_string(string, position, character): l=list(string); l[position]=character return ''.join(l)