# 16. File handling
#file = open("apples.txt", "w")
# modes
# write, "w"
def write_file(file_name, stuff):
    file = open(file_name, "w")
    file.write(stuff)
    file.close()

#write_file("apples.txt", "Yo nothing is upp")

# read, "r"
def read_file(file_name):
    file = open(file_name, "r")
    stuff = file.read()
    print(stuff)
    file.close() # ← always close the file

#read_file("apples.txt") # ← take care of the existence of the file

# append, "a"
def append_file(file_name, stuff):
    file = open(file_name, "a")
    file.write(stuff)
    file.close()

append_file("apples.txt", ", really something is definitely up")
read_file("apples.txt")

74429818287a0e8307f818d8092ef296132c0789
<mask token>


def read_file(file_name):
    file = open(file_name, 'r')
    stuff = file.read()
    print(stuff)
    file.close()


<mask token>

def write_file(file_name, stuff):
    file = open(file_name, 'w')
    file.write(stuff)
    file.close()


def read_file(file_name):
    file = open(file_name, 'r')
    stuff = file.read()
    print(stuff)
    file.close()


<mask token>

def write_file(file_name, stuff):
    file = open(file_name, 'w')
    file.write(stuff)
    file.close()


def read_file(file_name):
    file = open(file_name, 'r')
    stuff = file.read()
    print(stuff)
    file.close()


def append_file(file_name, stuff):
    file = open(file_name, 'a')
    file.write(stuff)
    file.close()


<mask token>

def write_file(file_name, stuff):
    file = open(file_name, 'w')
    file.write(stuff)
    file.close()


def read_file(file_name):
    file = open(file_name, 'r')
    stuff = file.read()
    print(stuff)
    file.close()


def append_file(file_name, stuff):
    file = open(file_name, 'a')
    file.write(stuff)
    file.close()


append_file('apples.txt', ', really something is definitely up')
read_file('apples.txt')

# 16. File handling
#file = open("apples.txt", "w")
# modes
# write, "w"
def write_file(file_name, stuff):
    file = open(file_name, "w")
    file.write(stuff)
    file.close()

#write_file("apples.txt", "Yo nothing is upp")

# read, "r"
def read_file(file_name):
    file = open(file_name, "r")
    stuff = file.read()
    print(stuff)
    file.close() # ← always close the file

#read_file("apples.txt") # ← take care of the existence of the file

# append, "a"
def append_file(file_name, stuff):
    file = open(file_name, "a")
    file.write(stuff)
    file.close()

append_file("apples.txt", ", really something is definitely up")
read_file("apples.txt")
