[Tutor] A dictionary question

Phil phillor9 at gmail.com
Sat Nov 13 02:14:36 EST 2021


On 13/11/21 15:45, dn via Tutor wrote:
> What a ghastly exercise. Is it homework?

No, just a project to keep myself occupied. There must be easier way to 
find the two pairs.

>
> Note that "count_dict['row'] = j" only allows for one set-location to be
> noted. Accordingly, change the value of the dictionary to be a list.

Thank you dn, I didn't think of that in my frazzled state.

> The last print() will then look something like:
>
> {'row': [1, 5], 'count': 2, 'set': {4, 6}}

Indeed it does. Thank you again.

-- 

Regards,
Phil



More information about the Tutor mailing list