# reading whole file at a time
# lines at a time using list
# writing line by line / whole 






fw = open('sample.txt', 'w')
fw.write('Writing some stuff in my text file\n')
fw.write('Another sample line\n')
fw.close()

fr = open('sample.txt', 'r')
text = fr.read()
print(text)
fr.close()
47f122754b460a21b43b2ed042b9272a4b6354f8
<mask token>

<mask token>
fw.write('Writing some stuff in my text file\n')
fw.write('Another sample line\n')
fw.close()
<mask token>
print(text)
fr.close()

fw = open('sample.txt', 'w')
fw.write('Writing some stuff in my text file\n')
fw.write('Another sample line\n')
fw.close()
fr = open('sample.txt', 'r')
text = fr.read()
print(text)
fr.close()

# reading whole file at a time
# lines at a time using list
# writing line by line / whole 






fw = open('sample.txt', 'w')
fw.write('Writing some stuff in my text file\n')
fw.write('Another sample line\n')
fw.close()

fr = open('sample.txt', 'r')
text = fr.read()
print(text)
fr.close()