我不断收到此代码的属性错误。有谁知道为什么会这样?我知道不能附加“str”,但我正在尝试附加列表......任何帮助将不胜感激!
elif choice == "1":
i=0
eval_type = open("eval_type.txt", "r+")
for line in eval_type:
i+=1
new_eval = input("What do you want to call the new evaluation?")
points = input("How many points is this type worth?")
if new_eval in line:
print("\n", new_eval, "already exists.")
else:
eval_type.append(new_eval)
print (new_eval, "has been added.")
eval_type.close()