我必须从 HP Codewars 2012 返回 spellbinder 程序,我不知道自己在做什么。这是我到目前为止所拥有的,请帮忙。我正在使用 python 3.3.0。这是链接http://www.hpcodewars.org/past/cw15/problems/2012ProblemsFinalForPrinting.pdf
def fix (string):
'''The function of the repaired by a
speelbot abused Dictionary
word -> word to be repaired
a -> the point-to-exchange
b -> the correct letter
'''
word, a, b = string.split ( " " )
return word.replace (a, b)
for word in [ '"MUSTARD MC " , "JUNK J TR" , "MONSTER ON A" ']:
print (word, "->" to repair (word))