Page 1 of 1

frozensets

PostPosted: Fri Sep 30, 2016 2:00 pm
by pcoder
Here is the code I am testing.

Code: Select all
>>> from geoip import geolite2
>>> match = geolite2.lookup('17.0.0.1')
>>> match is not None
True
>>> match.country
'US'
>>> match.continent
'NA'
>>> match.timezone
'America/Los_Angeles'
>>> match.subdivisions
frozenset(['CA'])


How do I just get CA out of the frozenset because when I save this in a variable and print it it shows frozenset(['CA'])

Code: Select all
>>> a = match.subdivisions
>>> print(a)
frozenset(['CA'])
>>>