John Doe John Doe - 10 months ago 34
Python Question

Writing list to file -- File written to not found

I am using Python 3.

This is a script that i am in the process of writing. It asks for a name/birthday, takes that input, and appends it into a list. The list is then written to another file.

I have done research on this and can't find why it isn't working.

Here is my code:

print("""Enter the name and birthday of the person like this:
Adam 1/29

all_birthdays = [ "none so far" ]

while True:
birthday = input("> ").upper()

if birthday == "":

if birthday == "LIST":

if birthday not in all_birthdays:
print("This name/birthday is already known")

birthday_list = open('test.txt','w')

for bday in all_birthdays
birthday_list.write("%s\n" %bday)

SECOND EDIT: I added code ( bottom-most for loop and the create file ). It worked, but i can't seem to even find the file anywhere. Any help? How can i find it and open it?
This code was found at: Writing a list to a file with Python


This line:

 birthday = input("> ").upper

Should be:

 birthday = input("> ").upper()

The former assigns the upper function to the variable birthday rather than the uppercase of the input string.