![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
![デイヴ 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)