0
Writing on a file
Please i need help with the exercise of the file writing lesson: n = int(input()) file = open("numbers.txt", "w+") #tu cĂłdigo va aquĂ for i in range(n): file.write(str(i+1)+"\n") file.close f = open("numbers.txt", "r") print(f.read()) f.close() I donât have any output. Why is this wrong? What am i doing wrong? Thanks for your help
3 Answers
+ 6
file.close needs the parentheses
file.close()
Maybe this was causing the issue?
+ 1
đ€Šđ»ââïž yes that was the problem Apollo-Roboto thanks a lot đ