Challenge #4: Object Representation and Iteration

Franccesco Orozco edited this page May 6, 2018 · 4 revisions

Dificulty: :star::star::star:

Test: pipenv run python -m unittest tests/test_challenge_4.py -f


Instructions

  • Change the object representation of your class to return Geolocation information of IP_ADDR where IP_ADDR is equal to the IP address of the requested JSON data stored in self.ip_data
  • Create a iterable method that allows iteration in your class. For every key and value stored in the dictionary self.ip_data you should yield a (key, value) tuple, e.g: ('ip', '8.8.8.8'). This way you should be able to yield a generator.

Documentation

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.