My task here is to write a function called fix_yz. This function takes a single argument which will be a string. My function returns this string with all of the ys and zs swapped, and all of the Ys and Zs swapped. What i have done:
replace = {"Y":"Z","y":"z","Z":"Y","z":"y"}
def fix_yz(Input):
replaced=[]
for yzYZ in Input:
if yzYZ in replace:
yzYZ = replace[replaced]
replaced.append(yzYZ)
return ''.join(replaced)
although i get a error and i dont understand which line to work on.