Question #231118

Write a function in PYTHON to add new record at the bottom of a file “STUDENT”


Expert's answer

filename="example_file.txt"


file = open(filename, 'a')


for i in range(0, 5):
    name = input ("Enter a name: ")
    file.write(name + "\n")


file.close()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS