#588 · File handling · Intermediate · 65 XP · about 12 min
A club keeps its members in a text file, one name per line. Write add_member(filename, name) that adds name at the end of the file on a line of its own, unless the file already lists that member. Return True when the name was added and False when it was already there.
' ben' is already there if the file has Ben.If club.txt holds Asha and Ben on two lines:
add_member('club.txt', 'Cara') # returns True: the file now lists Asha, Ben, Cara add_member('club.txt', 'ben') # returns False: Ben is already a member
First solves only, ranked by stars and then time.