Hi, I completed exercise 7/9 The ‘with’ and ‘as’ Keywords on Codecademy, but I have another issue. I am coding in Jython Environment for Students (JES) for a class and I wanted to practice the exercise there. When I type in the same code:
with open("text.txt", "w") as textfile: textfile.write("Success!")
JES tells me that there is a syntax error. It does not give me any more information beyond that.
Invalid syntax. Your code contains at least one syntax error, meaning it is not legal Jython.
I’m a little confused why Codecademy likes it, but not JES. I understand that Jython is a variation of Python, so could that be why there is a problem?