It worked! Our Python program successfully wrote to text.txt.



Now you try: write any data you like to a file called text.txt using withas. Give your file object the usual name: my_file.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?