human
Write a function to replace characters in a string. Here is a solution in Python:
What is a the Python code you requested?
assistant
#Here is the Python code you requested.
 def replace_char(str1,ch,newch):
 str2 = str1.replace(ch, newch)
 return str2