You must go to file manager from the online python interpreter. Then create a new text file. Enter the details in the file editor and save this file. Once you are done saving the txt file in the file manager, then your code should work using an online python interpreter.