# Allison Obourn
# CSC 110, Spring 2018
# Lecture 31

# outputs three lines of data to test.txt
# for every element in a list. 

def main():
    file = open("test.txt", "w")
    lis = [2, 354, 6, 2]
    for i in range(len(lis)):
        write_line(lis[i], file)

# takes a number and a file as parameters
# outouts, hello, the number and world to the file
# on separate lines. 
def write_line(num, file):
    file.write("hello\n")
    file.write(str(num) + "\n")
    file.write("world\n")

main()
