On Thu, 7 Jul 2005, Nathan Pinno wrote:

>   Why does invalid syntax popup?


<snip>

>   def lookup_login_command(site,filename):
>       print "Lookup a login info card"
>           site = raw_input("Site: ")
>           if sitelist.has_key(site):
>               print "The ID is: ",sitelist[site][0]
>               print "The password is: ",sitelist[site][1]
>           else:
>               print site," was not found."

Bad indentation.  Try this instead:


def lookup_login_command(site,filename):
    print "Lookup a login info card"
    site = raw_input("Site: ")
    if sitelist.has_key(site):
        print "The ID is: ",sitelist[site][0]
        print "The password is: ",sitelist[site][1]
    else:
        print site," was not found."

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to