def variable_subsitution(text, dic):
for x, y in dic.items():
text = text.replace(x,y)
return text
variable="Michael"
txt=variable_subsitution("Michaek","Michael")
Traceback (most recent call last):
File "vend.py", line 7, in <module>
txt=variable_subsitution("Michaek","Michael")
File "vend.py", line 2, in variable_subsitution
for x, y in dic.items():
AttributeError: 'str' object has no attribute 'items'