"""Write a function changeString that has one parameter - string. The function returns a new string based on the following rules: character & replaced by letter a character # replaced by letter A all other characters remain the same Write main to test your function. """ def changeString(str): #solution 1 str1=str.replace('&','a') str2=str1.replace('#','A') return str2 """solution 2 new_str="" for item in str: if(item=='&'): new_str+='a' elif(item=='#'): new_str+='A' else: new_str+=item return new_str """ def main(): #we will create a list of strings first and then make new list with new strings list=[] for i in range(5): str=input("enter string ") list.append(str) new_list=[] for item in list: new_list.append(changeString(item)) print(list) print(new_list) main()