当我运行代码时,它不会用字母替换破折号,而是将其添加到现有的破折号上。有谁知道如何解决这一问题?
谢谢。
a = 0
new = ""
while a < limit:
for i in range(len(formula2)):
if (formula2[i] == partial_fmla[i]):
new[i] = new + partial_fmla[i]
elif (formula2[i] == guess):
new[i] = guess
else:
new = new + "-"