wordnet semantic similarity: how to refer to elements of a pair in a list? can we sort dictionary according to the value?
tjreedy at udel.edu
Sun Oct 7 21:53:35 CEST 2012
On 10/7/2012 12:15 PM, Token Type wrote:
> In this case, I need to use loop to iterate each element in the above
> pairs. How can I refer to each element in the above pairs, i.e. pairs
> = [(car, automobile), (gem, jewel), (journey, voyage) ]. What's the
> index for 'car' and for 'automobile'? Thanks for your tips.
>>> pairs = [('car', 'automobile'), ('gem', 'jewel')]
>>> for a,b in pairs: a,b
Terry Jan Reedy
More information about the Python-list