Python Syntax error in opening file


#1


https://www.codecademy.com/en/courses/python-intermediate-en-OGNHh/1/4?curriculum_id=4f89dab3d788890003000096#

File "python", line 1
with open("text.txt,"r") as my_file:
^
SyntaxError: EOL while scanning string literal

Oops, try again. Your syntax doesn't look quite right. Check the Hint if you need help.


with open("text.txt,"r") as my_file:
    my_file.write("Whatever")


#2

It should now be obvious the problem, as you've formatted your code.

with open("text.txt,"r") as my_file:

Do you see where the colors are off?


#3

As cadecodes has hinted, you have missed out a quotation mark.

Try:
with open("text.txt","r") as my_file:
my_file.write("Whatever")