当我定义这个函数时有一个语法错误。在
def questionfilehandler("filename.txt"):
with open("filename.txt", "r") as file:
print(file.read)
return input()
file.close()
我查过语法,似乎都是正确的。
This is the error message I got
And this is the code with the error highlighted by IDLE.
感谢每一位阅读并试图回答这个问题的人。非常感谢您的时间。在
假设你的压痕是固定的,这很明显。。。不能将字符串作为函数参数直接调用。你需要一个变量:
然后。。。可以使用字符串作为参数调用函数:
^{pr2}$不需要文件名.close()作为“with”运算符自动处理。在
相关问题 更多 >
编程相关推荐