![デイヴ on X: "#AdventOfCode2020 Day 6 in #Python from collections import Counter data = [ (Counter(l.replace('\n', '')), len(l.split('\n'))) for l in open('06').read().split('\n\n') ] print('Pt 1:', sum(len(g) for g,_ in data), '\nPt 2:', デイヴ on X: "#AdventOfCode2020 Day 6 in #Python from collections import Counter data = [ (Counter(l.replace('\n', '')), len(l.split('\n'))) for l in open('06').read().split('\n\n') ] print('Pt 1:', sum(len(g) for g,_ in data), '\nPt 2:',](https://pbs.twimg.com/media/EpIe3NLXUAAT8rh.jpg:large)
デイヴ on X: "#AdventOfCode2020 Day 6 in #Python from collections import Counter data = [ (Counter(l.replace('\n', '')), len(l.split('\n'))) for l in open('06').read().split('\n\n') ] print('Pt 1:', sum(len(g) for g,_ in data), '\nPt 2:',
![Collections in Python. As we know python also comes with a… | by Jagpreet Kaur | AI Perceptron | Medium Collections in Python. As we know python also comes with a… | by Jagpreet Kaur | AI Perceptron | Medium](https://miro.medium.com/v2/resize:fit:1378/1*KOTir34Dv1hQ5tPVMm3yww.png)
Collections in Python. As we know python also comes with a… | by Jagpreet Kaur | AI Perceptron | Medium
![python - "NameError: name 'Counter' is not defined" on Jupyter Notebook but works fine on PyCharm? - Stack Overflow python - "NameError: name 'Counter' is not defined" on Jupyter Notebook but works fine on PyCharm? - Stack Overflow](https://i.stack.imgur.com/BHLsx.png)
python - "NameError: name 'Counter' is not defined" on Jupyter Notebook but works fine on PyCharm? - Stack Overflow
![Practice>Python>Collections>collections.Counter() · Issue #76 · jmpark0118/CODING_TEST_PRACTICE · GitHub Practice>Python>Collections>collections.Counter() · Issue #76 · jmpark0118/CODING_TEST_PRACTICE · GitHub](https://user-images.githubusercontent.com/47072401/97177130-5b2dc380-17d9-11eb-8c5b-5b5219773061.png)