请问各位python大佬为什么我写的程序出现flag未定义的错误

a = 'words_file.txt'
b = open(a,'r',encoding='utf_8')
c=b.read()
d =a.strip('.')
new_file = open(flag[0]+'new_file'+'.txt','w',encoding='utf_8')
new_file.write(c)
b.close()
print(new_file.read())
new_file.close()

Traceback (most recent call last):
File "C:\Users\LENOVO\PycharmProjects\pythonProject\2.py", line 5, in
new_file = open(flag[0]+'new_file'+'.txt','w',encoding='utf_8')
NameError: name 'flag' is not defined. Did you mean: 'float'?

进程已结束,退出代码1

你的flag确实没有提前声明,你得看一下是不是真的有那个文件名

img


这里的flag下面都有红线,请问这是哪里来的