Skip to content
Advertisement

Tag: list

build a set from 3 lists – Python

I’ve got below chunk and I need to define ‘Score’ as the intersection / union for each set of words in any given two lists. I understand & and | could only be used in sets. From studytonight I get that below code shoud work but it’s gving me > TypeError: unhashable type: ‘list’ Could someone please correct my mistake?

Different lines of input and output in Python

I’m currently trying to solve the max value problem. However, I’m now having a hard time getting many outputs at the same time. I try to use input().splitlines() to do it, but I only get one output. The test case and output need to have many lines just as the box’s examples. If anyone can provide me with some assistance,

Advertisement