repl.it
@JerryTheMouse/

File reading test

Python

No description

fork
loading
Files
  • main.py
  • a.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
"Delete a.txt before run test"
f = open("a.txt", "a+")
f = open("a.txt", "r+")

for i in range (0, 2):
  print ("Iteration: " + str(i))
  print ("Writing file...")
  f.write("Complete")
  print ("\nReading file...")
  print(f.read())
?