# Source: https:// www.guru99.com/reading-and-writing-files-in-python.html'

# Data to be outputted
data = ['first','second','third','fourth','fifth','sixth','seventh']

# Get filename, can't be blank / invalid
# assume vaild data for now.
filename = input("Enter a Filename (leave off the extension): ")

# add .txt suffix!
filename = filename + ".txt"

# create file to hold data
f = open(filename, "w+")

# add new line at end of each item\
for item in data:
    f.write(item + "\n")

 # close file
    f.close()
c40f5085d732e88cf8e19ef65f694962819e9dcb
<mask token>

<mask token>
for item in data:
    f.write(item + '\n')
    f.close()

data = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh']
filename = input('Enter a Filename (leave off the extension): ')
filename = filename + '.txt'
f = open(filename, 'w+')
for item in data:
    f.write(item + '\n')
    f.close()

# Source: https:// www.guru99.com/reading-and-writing-files-in-python.html'

# Data to be outputted
data = ['first','second','third','fourth','fifth','sixth','seventh']

# Get filename, can't be blank / invalid
# assume vaild data for now.
filename = input("Enter a Filename (leave off the extension): ")

# add .txt suffix!
filename = filename + ".txt"

# create file to hold data
f = open(filename, "w+")

# add new line at end of each item\
for item in data:
    f.write(item + "\n")

 # close file
    f.close()