[Tutor] find pickle and retrieve saved data
stephanie.quiles001 at albright.edu
Mon Aug 3 14:13:29 CEST 2015
I'm trying to tell it to print everything under that particular name. I would have to def info, correct? But set it equal to what to make it work?
Sent from my iPhone
> On Aug 3, 2015, at 3:12 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>> 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 == 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.
>> print("Entry not Found! Try again.")
> Alan G
> Author of the Learn to Program web site
> Follow my photo-blog on Flickr at:
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
More information about the Tutor