我正在尝试编写一个代码,该代码将获取一个文件,查看这些字母,然后将它们放入其他字母中。听到是我的代码。
def decode():
dd=input("would you like to type the message or read a file that has the message?:")
if dd in['read']:
e=open("file.txt", 'r')
for i in range(7):
ff=e.read()
if ff in['wen']:
print("new")
...
e.close()
decode()
输出是
would you like to type the message or read a file that has the message?: read
>>>
想法?