Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python also supports the '_' character in that same manner. It's just a legal variable name that is given special meaning when in the interactive interpreter.

    >>> p = { "Alice": ["g", 1, "a@a"], "Bob": ["b", 2, "b@b"]}
    >>> [(name, email) for name, (_, _, email) in p.iteritems()]
    [('Bob', 'b@b'), ('Alice', 'a@a')]


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: