import requests
import json

class IPAddressDisplayer:
    # What's this? Class variable? Public, private?
    url = "https://api.ipify.org?format=json"

    def __init__(self):
        pass

    def get_name(self):
        return input("Enter your name: ")

    def get_ip_address(self):
        http_response = requests.get(self.url)
        print(type(http_response))
        if http_response.status_code == 200:
            return json.loads(http_response.text)['ip']
        else:
            raise Exception(http_response.status_code)

    def get_result(self, user_name, ip_address):
        return_text = "Hello " + user_name + "! Your IP address is: " + ip_address + "."
        return return_text

ip_address_displayer = IPAddressDisplayer()
ip_address = ip_address_displayer.get_ip_address()
