On 03/08/15 04:04, Quiles, Stephanie wrote:

def main():
...
     name_search = input("Enter a name in the file for info: ")

     for name in emails:
         if name[0] == name_search:
             print("This is the info: ", info)

What is info? Is it supposed to be name? or name[1:]?
Its not set anywhere in your code.

         return emails

Notice the return is outside the if block.
So you always return on the first element of the for loop.

     else:
         print("Entry not Found! Try again.")

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to