python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
f = open("test.txt", "w") f.write("India, America, Pakistan, China, Italy") f.close() #open and read file after the appending: f = open("test.txt" , "r") print(f.read()) f = open("test.txt") print(f.read()) f = open("test.txt") print(f.read(4)) print(f.read(3)) print(f.read(4)) f.close() f = open("test.txt") print(f.readline()) f.close() f = open("test.txt") print(f.readline(1)) print(f.readline()) print(f.readline()) f.close()
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up