If you just want to change the different characters at random index in a string the below function will help. This script will ask for the input string(i.e., word) and the total places/ indexes ((i.e.,)value or 'n' places) you need to change with random characters, and this will print the modified string as needed.
import random
import string
# Method to change N characters from a string with random characters.
def randomlyChangeNChar(word, value):
length = len(word)
word = list(word)
# This will select the two distinct index for us to replace
k = random.sample(range(0,length),value)
for index in k:
# This will replace the characters at the specified index with
# the generated characters
word[index] = random.choice(string.ascii_lowercase)
# Finally print the string in the modified format.
print("" . join(word))
# Get the string to be modified
string_to_modify = raw_input("Enter the string to be replaced...\n")
# get the number of places that needed to be randomly replaced
total_places = input("Enter the total places that needs to be modified...\n")
# Function to replace 'n' characters at random
randomlyChangeNChar(string_to_modify, total_places)
Output
Enter the string to be replaced...
Hello
Enter the total places that needs to be modified...
3
Hcado