repl.it
@JordanDixon1/

(Name of Repl)

Python

No description

fork
loading
Files
  • main.py
  • file.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Opening the File and telling it to write hello world and if the file isn't created then create it.
#f = open('file.txt','w+')
#f.write('Hello World!')
#f.close()



#This code is for after the file had been created.

#opens the file and appends Hello World! to it.
f = open('file.txt', 'a')
f.write('\nHello World!')

#closes the operation
f.close()



#Opens the file as a read operation Then prints it to the terminal to the right.
f = open('file.txt', 'r')
contents = f.read()

print(contents)


#closes the reading operation.
f.close()
Fetching token
?