"""
Python makes performing file I/O simple. Take a look
at how to read and write to files here: 

https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
"""

# Open up the "foo.txt" file (which already exists) for reading
# Print all the contents of the file, then close the file

# YOUR CODE HERE

f = open("src/foo.txt", "r").read()
print(f)


# Open up a file called "bar.txt" (which doesn't exist yet) for
# writing. Write three lines of arbitrary content to that file,
# then close the file. Open up "bar.txt" and inspect it to make
# sure that it contains what you expect it to contain

# YOUR CODE HERE

# Open and creates file that doesnt exist. w+ means to write
f_bar = open("bar.txt", "w+")

# Loop to write data to file
for i in range(3):
    f_bar.write(f'Howdy character #{i} ')

# Close file when done
f_bar.close()
