Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ Visits
Class
Visits
example_code/item_027.py:73–79 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
71
72
print(
"Example 3"
)
73
class
Visits:
74
def
__init__(self):
75
self.data = {}
76
77
def
add(self, country, city):
78
city_set = self.data.setdefault(country, set())
79
city_set.add(city)
80
81
82
print(
"Example 4"
)
Callers
1
item_027.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected