13 "cell_type": "markdown",
16 "Import the names, splitting the lines into individual names."
32 "output_type": "execute_result"
36 "invites = [line.strip().split(', ') for line in open('../../data/00-invites.txt')]\n",
41 "cell_type": "markdown",
44 "Find the line with most names"
60 "output_type": "execute_result"
64 "max(len(invite) for invite in invites)"
68 "cell_type": "markdown",
71 "Create a `Counter` from the flattended list of list of names. Then count how many items are in the `Counter` with a count of more than 1."
87 "output_type": "execute_result"
91 "invite_counts = collections.Counter(name for invite in invites for name in invite)\n",
92 "sum(1 for name in invite_counts if invite_counts[name] > 1)"
97 "execution_count": null,
105 "display_name": "Python 3",
106 "language": "python",
114 "file_extension": ".py",
115 "mimetype": "text/x-python",
117 "nbconvert_exporter": "python",
118 "pygments_lexer": "ipython3",